Garbage Collecting the World: One Car at a Time
description
Transcript of Garbage Collecting the World: One Car at a Time
![Page 1: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/1.jpg)
Garbage Collecting the World: One Car at a Time
Richard L. Hudson, Ron Monison,~ J. Eliot B. Moss, &David S. Munrot
Department of Computer Science, University of Massachusetts,Amherst, MA 01003, U.S.A. ’
Email: { hudson, moss} @cs.umass.edu
Schoo1 of Mathematical and Computational Sciences,University of St Andrews, North Haugh, St Andrews, Fife,
KY16 9SS, ScotlandEmail: (ron, dave} @dcs.st-and.ac.uk
Presented by: Martin Krogel
![Page 2: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/2.jpg)
Outline
Goals Assumptions DMOS Collector
Rules Example Addressing Objects Pointer Tracking Object Substitution Protocol Car and Train Management Unwanted Relative Problem Cleaning up Trains Safety and Completeness
Related Works Conclusion Future Work Questions?
![Page 3: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/3.jpg)
Goals
Motivation was to provide garbage collection for distributed systems with the following properties.
Safety Completeness Non-disruptiveness Incrementality Scalability Non-blocking
![Page 4: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/4.jpg)
Assumptions
Nodes have local storage and only use message passing.
Ordered delivery of messages. Nodes appear to operate correctly. No bounds on relative computation rates. Events at a node are totally ordered.
![Page 5: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/5.jpg)
DMOS Collector
(Distributed Mature Object Space) Based on MOS and PMOS garbage
collection. Uses trains and cars analogy. Also uses relative ages of trains.
![Page 6: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/6.jpg)
Rules
1) Data locally reachable from roots is copied to a younger train.
2) Data locally reachable from younger trains is copies to those trains. (If from multiple trains, any will do.)
3) Data locally reachable from older trains is copied to another car in the current train.
4) Data locally reachable from other cars of the same train is copied to another care of the same train.
5) All remaining data is unreachable and is reclaimed.
![Page 7: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/7.jpg)
Rules (handling cycles)
0) If no object in a train is reachable from outside the train, collect the entire train.
1) Data locally reachable from roots is copied to a younger train.
2) Data locally reachable from younger trains is copies to those trains. (If from multiple trains, any will do.)
3) Data locally reachable from older trains is copied to another car in the current train.
4) Data locally reachable from other cars of the same train is copied to another care of the same train.
5) All remaining data is unreachable and is reclaimed.
![Page 8: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/8.jpg)
Rules (non-local trains)
0) If no object in a train is reachable from outside the train, collect the entire train.
1) Data locally reachable from roots is copied to a younger train.
2) Data locally reachable from younger trains is copies to those trains. (If from multiple trains, any will do.) If the destination train is not represented on this node, then the node should join the train and create a new car in that train.
3) Data locally reachable from older trains is copied to another car in the current train.
4) Data locally reachable from other cars of the same train is copied to another care of the same train.
5) All remaining data is unreachable and is reclaimed.
![Page 9: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/9.jpg)
Example (Step 1)
![Page 10: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/10.jpg)
Example (Step 2)
![Page 11: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/11.jpg)
Example (Step 3)
![Page 12: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/12.jpg)
Example (Step 4)
![Page 13: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/13.jpg)
Addressing Objects
DMOS objects encode logical address and home node.
Car numbers are not reused, or reused very slowly.
![Page 14: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/14.jpg)
Pointer Tracking Events
Event Description<s, n, o, A, B> This (send) event indicates that node A has sent to node B a pointer to o. The
number n is chosen such that no other event <s, m, o, A, B> has m=n, i.e., n, o, A, and B together uniquely identify the s event for all time and space. This event is said to happen at A (the sender), hence it is A's responsibility to inform H. Intuition: This indicates that a new pointer to o has been created in the virtual channel A -> B. The number n is used to match s events with their corresponding r events.
<r, n, o, A, B> This (receive) event indicates that node B has received a pointer to o sent by node A. The number n is chosen to match the corresponding s event. This event happens at B. Intuition: An r event indicates that the pointer has been deleted from the virtual channel A -> B and has been created in a message receive buffer at B.
<d, n, o, A, B> This (delete) event indicates that node B has deleted from its message buffers the received pointer to o uniquely identified by n, A, and B. The number n corresponds to the s and r messages previously described. This event happens at B.
<+, m, o, A> This event indicates that node A has created a new pointer, uniquely identified by m to object o. This event happens at A.
<-, m, o, A> This event indicates that node A has deleted the specific pointer, uniquely identified by m to object o. This event happens at A.
![Page 15: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/15.jpg)
Node A Sends to Node Ba Pointer to o
![Page 16: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/16.jpg)
Ordering of Events
any(o, Y, E) Indicates whether Y contains any pointers to o
based on information in the given set of events E.
<r, n, o, X, Y>, but no <d, n, o, X, Y> or <+, n, o, Y>, but no <-, n, o, Y>.
absence(o, E) True if and only if there are no pointers to o at
nodes other than o's home node H. any(o, X, E) is false for all nodes X other than H.
![Page 17: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/17.jpg)
Pointer Tracking Optimization
Removing the unique numbers from events. Referring fewer events to H. Further reducing the detail required at H. Piggy-backing and compressing messages. Combining events
Event Effect at H
<s, o, B> +<r, o, B> - +<+, o, B> +<-, o, B> -
inTransit(o, ->B) pointersTo(o, B)
![Page 18: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/18.jpg)
Object Substitution Protocol
When o is substituted by o' H creates KnownNodes(o) list H sends move message [m, o, o'] to known nodes X receives move message X inserts o o' in relocation table
X receives a pointer to o Generate received o message <r, o, X> Generate add o' message <+, o', X> Generate remove o message <-, o, X>
H receives message about o from X Check KnownNodes(o) If X is not present, add it and send move message.
If H' H H sends o' pointer to H' H forwards manipulation messages to H'
![Page 19: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/19.jpg)
Object Substitution Protocol
Cleaning up the Tables Check for absence(o, E) H sends and end of move message [e, o, o'] to X H removes X from KnownNodes(o) H removes o o' from relocation table X removes o o' from relocation table
Multiple Substitutions Opaque Addressing
![Page 20: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/20.jpg)
Car and Train Management
Solving completeness Remembered Sets and Sticky Remembered
Sets Basic train management
Identifying successor(X, n:A) Logical token passing ring Joining a ring
X sends join message [join, X, n:A] X becomes successor of A in ring
Leaving a ring X sends leave message [leave, X, successor(X, n:A),
n:A]
![Page 21: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/21.jpg)
Car and Train Management
Basic train management Identifying successor(X, n:A) Logical token passing ring Joining a ring
X sends join message [join, X, n:A] X becomes successor of A in ring
Leaving a ring X sends leave message [leave, X, successor(X, n:A),
n:A]
![Page 22: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/22.jpg)
Car and Train Management
How a node X should respond to a leave message [leave, Y, Z, n:A]. Case 1: Y = successor(X, n:A), i.e., X is Y's
predecessor: X sets successor(X, n:A) to be Z (Y's successor) and sends the message [left, n:A] to Y.
Case 2: Z = X and X is not in the process of leaving the ring: X sends the message [leave, Y, Z, n:A] to successor(X, n:A).
Case 3: Z = X and X is in the process of leaving the ring: X sends a [leave, Y, successor(X, n:A), n:A] message to successor(X, n:A).
![Page 23: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/23.jpg)
Two Nodes Leave a Train Ring at the Same Time
![Page 24: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/24.jpg)
Car and Train Management
Train Reclamation (using Token Passing) Initial state Starting the token Receiving the token
Rule 1: External pointers in sticky remembered sets for train
Rule 2: No external pointers, but “changed bit” is true Rule 3: No external pointers and “changed bit” is false
Special case: If Y receives token with value Y, there are no external pointers to the train, and it can be reclaimed
![Page 25: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/25.jpg)
Illustration of Correctness of Train Reclamation Algorithm
Assuming no new objects are added to the train
![Page 26: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/26.jpg)
Unwanted Relative Problem
![Page 27: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/27.jpg)
Unwanted Relative Problem
Rejected solutions Disallow moving unwanted relatives into n:A Delay moving relative Only reclaim oldest trains
Accepted solution: Epochs (old/new) When a token is started, all cars are considered old
epoch. Cars added while “changed bit” is false are considered
new epoch Cars added while “changed bit” is false are considered
old epoch If “changed bit” switches from false to true, all cars on
train are considered old epoch “Changed bit” is only set when pointer is detected to old
epoch car in the train
![Page 28: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/28.jpg)
Cleaning up Trains
X receives the token for n:A with value X. (Old epoch cars are unreachable). X deletes old epoch cars X sends [end-of-epoch, X] message.
Y receives end-of-epoch message and Y X. Y deletes old epoch cars Y changes new epoch cars to old epoch cars Y forwards message
X receives end-of-epoch message. X restarts token passing algorithm
If train is oldest, there will be no new epoch cars, so the train will be fully collected.
![Page 29: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/29.jpg)
Safety and Completeness
Safety Object substitution Car / Train reclamation
Completeness Oldest train will eventually be collected
![Page 30: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/30.jpg)
Related Works
Migration Bishop's non-distributed garbage collection algorithm
Reference Counting Bevan's, and Watson & Watson's weighted reference counting. Reference listing. Optimized weighted reference counting with background global
tracing. Tracing
Hughes' global timestamped live object trace Liskov and Ladin suggest centralized time server
Lang, Queninnec, and Piquer's grouped mark/sweep algorithm. Ferreira and Shapiro's multiple site segment replication Maheshwari and Liskov's partitioned garbage collection
Garbage Tracing Vestal's test decrement of suspected cyclic garbage Lins & Jones' combining weighted reference counting with mark and
sweep from deletion points (not roots). Maeda et al. And Fuchs' tracing potentially cyclic garbage
![Page 31: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/31.jpg)
Conclusion
DMOS is a new distributed garbage collection algorithm that satisfy all of the following properties:
Safety Completeness Non-disruptiveness Incrementality Scalability Non-blocking
![Page 32: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/32.jpg)
Future Work
Implementation and practical evaluation. Algorithmic performance analysis. Extension to tolerate node and
communications failures.
![Page 33: Garbage Collecting the World: One Car at a Time](https://reader034.fdocuments.net/reader034/viewer/2022051417/56814e62550346895dbc00d1/html5/thumbnails/33.jpg)
Questions?