In G1, the remembered set (RSet) of a heap region (say R) has three types: sparse, fine, and coarse. Fine-entries are organized in a hash table, with each entry (say E) corresponding to a region that potentially has references into R. During GC pauses, if an entry E corresponds to a region that's a GC alloc region (i.e., we are copying objects into it), then the entry is "expanded". This means that the entry gets T - 1 extra tables (where T is the number of GC threads). This way, each such table can be updated by a GC thread without any synchronization (as each table can only be updated by only one GC thread). GC thread 0 still updates the "main" entry. At the end of the pause, all the expanded tables are collapsed and the information from them is propagated into the main table. In the current version of G1, the expanded tables are not heavily used / used at all given that we try to defer the RSet updates (not do them immediately during a pause but defer them to the concurrent refinement threads). Given that they are not used and add code complexity, it'd be helpful to remove them to simplify the RSet code.
|