list processing in real time on a serial computer henry g. baker, jr. cs395t: hadi esmaeilzadeh...
TRANSCRIPT
List Processing in Real Time on a Serial
ComputerHenry G. Baker, Jr.
CS395T: Hadi EsmaeilzadehFebruary 2009
Outline
List Processing and Real-Time Garbage CollectionThe Minsky-Feinchel-Yochelson-Cheney-Arnborg (MFYCA) Copying GC MethodThe Serial Real-Time (SRT) GC MethodDiscussionCitation Statistics
List Processing and Real-Time Garbage CollectionInterpretation instead of compilation
Significantly increases the running timeGood compilers and new languages (SIMULA)
Inefficient storage structureCompilersCompact list representation CDR-coding
Garbage collectionTrace and mark all the accessible cellsBaker’s SRT System
Serial Real-Time GC System (Baker’s Algorithm)
Time required by each of the elementary operations
Bounded by a constant factor Independent of the number of live cellsPseudo real-time
Based on MFYCA’s copying GC algorithm (SIMULA)Basic idea: copy a small portion during each cons rather than copying a lot infrequentlySingle-processor solutionSpace efficiency
Before Garbage Collection
Flip is the first step of garbage collection.
QuickTime™ and a decompressor
are needed to see this picture.
MFYCA Algorithm: Copying The First Step
The cells pointed by registers are the first copied cells.
QuickTime™ and a decompressor
are needed to see this picture.
MFYCA Algorithm: Copying the Roots
Now the registers contain the forwarding addresses.
QuickTime™ and a decompressor
are needed to see this picture.
MFYCA Algorithm: Copying …
The dashed arrows show the forwarding addresses.
QuickTime™ and a decompressor
are needed to see this picture.
MFYCA Algorithm: Copying … Done!
The fromspace is now contains garbage.
QuickTime™ and a decompressor
are needed to see this picture.
MFYCA is Simple and ElegantOne path algorithm instead of 3 paths of
MarkSweepRelocate
No collector stack
Baker’s Algorithm and kKey idea: perform k iterations of GC before each allocationBoth semispaces contain accessible cells
User program is tricked to believe the GC is finished at the last flip time
All the registers are updated right after flipNew allocations are performed at the top of tospaceEach car and cdr checks for a forwarding address and updates if found
Baker’s Algorithm: Before GC (k=2)
The cells pointed to by registers are moved at the flip time.
QuickTime™ and a decompressor
are needed to see this picture.
Baker’s Algorithm: Copy the Roots (k=2)
Both of semispaces contain live cells.
QuickTime™ and a decompressor
are needed to see this picture.
Baker’s Algorithm: CONSing (k=2)
New nodes are allocated at the top of tospace.
QuickTime™ and a decompressor
are needed to see this picture.
Discussion: Time-Space Trade offAll operation required bounded time
Independent of the number of live cells o(1)CONSing: c + k
(1 + 1/k) as much storage as needed by MFCYA
Trading space for timek=4 -> k=8 => 10% space saving
Would we need such a mathematical analysis?
Discussion: Space
Paper is very concerned about space (?!!)
With large k’s MFYCA and SRT use the same amount of storageMax MKSMW storage <= N(1.5+2m)Max SRT storage < N(2 + 2m)
Do we care about space?What do we care most about?How about embedded systems and portable devices?
Discussion: Unsupported CasesNo bounded-time operations for
Virtual memory machines !??Array structures
Copy and trace time is proportional to the length of array
What about memory hierarchy and caches?How about working set size?
What if the whole working set could have fit in the cache?
Memory trafficPower
Discussion: Breadth-First OrderThe graph of live objects is traversed in breadth first order
MFYCA and Baker
Would we care?Locality
Discussion: Proof by InductionIncremental GC is proved to be correct by induction
How important is the poof of correctness?
Discussion: Multi-core EraIs Baker’s algorithm extendible to multi-core systems?
Most of them use coherent shared memory systems
Coherence and Caching!?
Discussion: Imperative LanguagesHow well Baker’s algorithm applies to operations other than the list operations?
Program stackVectors and arraysHash tables
What about imperative languages?
Conclusions
Baker’s SRT Algorithm based on MFYCA copying GC algorithmContributions
Real-time: all operations require bounded timeSerial and single threadedSpace efficient and flexible
Trade off between space and time (through adjusting k)
Proven to be correctIt doesn’t run out of space when it should not
Citation Statistics
ACM portal: 183Google scholar: 606Guy E. Blelloch , Perry Cheng, On bounding time and space for multiprocessor garbage collection, ACM SIGPLAN Notices, v.39 n.4, April 2004A. M. Cheadle , A. J. Field , S. Marlow , S. L. Peyton Jones , R. L. While, Exploring the barrier to entry: incremental generational garbage collection for Haskell, Proceedings of the 4th international symposium on Memory management, October 24-25, 2004, Vancouver, BC, CanadaAndrew W. Appel, Real-time concurrent collection on stock multiprocessors, ACM SIGPLAN Notices, v.39 n.4, April 2004David F. Bacon , Perry Cheng , David Grove , Michael Hind , V. T. Rajan , Eran Yahav , Matthias Hauswirth , Christoph M. Kirsch , Daniel Spoonhower , Martin T. Vechev, High-level real-time programming in Java, Proceedings of the 5th ACM international conference on Embedded software, September 18-22, 2005, Jersey City, NJ, USADanny Dubé , Marc Feeley, BIT: A Very Compact Scheme System for Microcontrollers, Higher-Order and Symbolic Computation, v.18 n.3-4, p.271-298, December 2005David Siegwart , Martin Hirzel, Improving locality with parallel hierarchical copying GC, Proceedings of the 2006 international symposium on Memory management, June 10-11, 2006, Ottawa, Ontario, CanadaSylvain Stanchina , Matthias Meyer, Mark-sweep or copying?: a "best of both worlds" algorithm and a hardware-supported real-time implementation, Proceedings of the 6th international symposium on Memory management, October 21-22, 2007, Montreal, Quebec, CanadaFilip Pizlo , Erez Petrank , Bjarne Steensgaard, A study of concurrent real-time garbage collectors, ACM SIGPLAN Notices, v.43 n.6, June 2008Wolfgang Puffitsch, Decoupled root scanning in multi-processor systems, Proceedings of the 2008 international conference on Compilers, architectures and synthesis for embedded systems, October 19-24, 2008, Atlanta, GA, USAPascal Cuoq , Damien Doligez, Hashconsing in an incrementally garbage-collected system: a story of weak pointers and hashconsing in ocaml 3.10.2, Proceedings of the 2008 ACM SIGPLAN workshop on ML, September 21-21, 2008, Victoria, BC, CanadaWolfgang Puffitsch , Martin Schoeberl, Non-blocking root scanning for real-time garbage collection, Proceedings of the 6th international workshop on Java technologies for real-time and embedded systems, September 24-26, 2008, Santa Clara, CaliforniaFilip Pizlo , Antony L. Hosking , Jan Vitek, Hierarchical real-time garbage collection, ACM SIGPLAN Notices, v.42 n.7, July 2007