RFR (M): 8035406: Improve data structure for Code Cache remembered sets

Thomas Schatzl thomas.schatzl at oracle.com
Mon Feb 24 03:40:10 PST 2014


Hi all,

  can I have reviews for this split-out from 8027295? It changes the
code cache remembered set data structure from a GrowableArray to a set
of chunks of nmethods.

This has two purposes:
- make code cache remembered set reclamation fast, i.e. with the current
implementation instead of malloc/free() just a few pointer operations
are required that are independent of size.

- further in the future, these chunks of nmethods can be used as unit of
distribution across threads to make code root scan less unbalanced
(JDK-8025813).

Further implementation details

- caches a number of free chunks in a global free list to avoid
malloc/free overhead of freeing chunks (which is a lot smaller too
because these chunks are evenly sized and small unlike the
GrowableArrays before)

- there is a new gc log section that prints code root chunk purge time
to diagnose future problem with that anyway.

- fix a problem that code root freeing was not protected by the
HeapRegionRemSet lock; for that I moved that lock up from
OtherRegionsTable to HeapRegionRemSet.

Alternatives like hash tables did not seem to have advantages: contrary,
they may suffer from the same issues when disposing the hash table array
itself.

Bug CR:
https://bugs.openjdk.java.net/browse/JDK-8035406

Webrev:
http://cr.openjdk.java.net/~tschatzl/8035406/webrev/

Testing:
jprt

Thanks,
  Thomas



More information about the hotspot-gc-dev mailing list