Speeding up GC
Paul Koning
pkoning@equallogic.com
Tue Jun 4 07:14:00 GMT 2002
Excerpt of message (sent 4 June 2002) by John Levon:
> On Tue, Jun 04, 2002 at 12:42:06PM +0200, Andi Kleen wrote:
>
> > Unfortunately changing pages to read only and back is rather expensive.
> > Cheaper would be to expose the hardware's page dirty bit to user space
> > and use it for this. Apparently some OS like Solaris support it already
> > (at least that is what the relevant function in the boehm-gc suggest)
> > I guess it could be added to Linux too.
>
> To be most useful that needs to be read/write interface so the dirty bit
> can be reset after a full GC, since the GC only cares about
> dirty-since-last-GC (variant of card marking), whereas the VM has other
> purposes for the dirty bit. It looks possible on x86 at least, by
> backing up the dirty bit for the VM's benefit into one of the pte bits
> that seem to be unused, as far as I can tell...
It also depends on having a *hardware* dirty bit mechanism. I don't
know about Sparc, but -- for example -- MIPS doesn't have any. You
can simulate it by making the page read-only and taking the page fault
on the first write, and indeed the documentation suggests this and
describes how an OS could do it. That of course wouldn't be all that
cheap.
paul
More information about the Gcc
mailing list