Overwriting closures without indirections
Simon Marlow
marlowsd at gmail.com
Mon Mar 29 04:37:11 EDT 2010
On 26/03/2010 17:50, Chris Nicholls wrote:
> Sure. Inside the RTS you would call recordMutableCap() after
> checking which generation the closure belongs to. I've just cleaned
> this up and added recordMutated(Capability *, StgClosure *) which
> does the generation check too, but that's part of some other work I
> haven't committed yet.
>
>
> Thanks! That works fine now, though it has a pretty negative effect on
> performance...
>
> I'd be interested to hear how you get on with closure overwriting:
> typically approaches like that have not been terribly successful in
> the past, and we tend to favour just allocating new objects these
> days because it's simpler. Also overwriting interacts badly with
> generational GC, as you've discovered. I suspect that
> update-in-place and generational GC might be mutually exclusive.
>
>
> Do you know of any work on GGC/update-in-place that you could point me
> to? Or, more generally, any papers on updating in-place are always
> interesting.
Typically when using generational GC with a language that does a lot of
mutation, you want to use a cheaper write barrier - this is what the
Java folks focus on. In GHC, because mutation is rare, we opted for a
relatively more expensive, but more accurate, write barrier. If you're
doing a lot of overwriting of old closures, that might tip the balance
towards a cheaper but less accurate write barrier.
Look at papers on write barriers, e.g.
@inproceedings{hosk92,
author = {Antony L. Hosking and J. Eliot B. Moss and Darko Stefanovi\'{c}},
title = "A Comparative Performance Evaluation of Write Barrier
Implementations",
crossref = "OOPSLA92",
pages = "92--109",
URL = "ftp://ftp.cs.umass.edu/pub/osl/papers/oopsla92.ps.Z"
}
@inproceedings{blac04b,
author = {Stephen M. Blackburn and Tony Hosking},
title = {Barriers: Friend or Foe?},
crossref = {ISMM04},
pages = {143--151},
doi = {10.1145/1029873.1029891}
}
@techreport{zorn90b,
author = "Zorn, Benjamin",
title = "Barrier Methods for Garbage Collection",
institution = "University of Colorado, Boulder",
year = 1990,
number = "CU-CS-494-90",
URL = "ftp://ftp.cs.colorado.edu/pub/cs/techreports/zorn/CU-CS-494-90.ps.Z",
month = Nov,
}
@inproceedings{wils92c,
title = "Uniprocessor Garbage Collection Techniques",
author = "Paul R. Wilson",
address = "University of Texas, USA",
crossref = "IWMM92",
URL = "ftp://ftp.cs.utexas.edu/pub/garbage/gcsurvey.ps",
}
Cheers,
Simon
More information about the Cvs-ghc
mailing list