[15] RFR 8245124: Shenandoah: optimize code root evacuation/update during concurrent class unloading

Zhengyu Gu zgu at redhat.com
Sat May 16 11:30:32 UTC 2020


Currently, we use general purpose ShenandoahNMethod::heal_nmethod() to 
evacuate/update nmethod during code root processing.
It is not optimal, as the method deals with several scenarios. Instead, 
we should apply closure to evacuat/update nmethod
directly. Inlining ShenandoahNMethod::oops_do() also helps.

Bug:https://bugs.openjdk.java.net/browse/JDK-8245124
Webrev:http://cr.openjdk.java.net/~zgu/JDK-8245124/webrev.00/

Sample:
Before:
Concurrent Class Unloading   =    0.231 s (a =     4046 us) (n =    57) 
(lvls, us =     2832,     3457,     3789,     4531, 5594)
   Unlink Stale               =    0.213 s (a =     3734 us) (n =    57) 
(lvls, us =     2500,     3164,     3477,     4199, 5293)
     System Dictionary        =    0.001 s (a =       12 us) (n =    57) 
(lvls, us =       10,       11,       12,       13, 16)
     Weak Class Links         =    0.000 s (a =        0 us) (n =    57) 
(lvls, us =        0,        0,        0, 0,        1)
     Code Roots               =    0.212 s (a =     3721 us) (n =    57) 
(lvls, us =     2480,     3145,     3477,     4180, 5280)
   Rendezvous                 =    0.007 s (a =      128 us) (n =    57) 
(lvls, us =       75,      105,      119,      121, 230)
   Purge Unlinked             =    0.008 s (a =      146 us) (n =    57) 
(lvls, us =       99,      125,      145,      148, 251)
     Code Roots               =    0.008 s (a =      145 us) (n =    57) 
(lvls, us =       97,      125,      145,      148, 249)
     CLDG                     =    0.000 s (a =        1 us) (n =    57) 
(lvls, us =        0,        0,        1, 1,        2)
     Exception Caches         =    0.000 s (a =        0 us) (n =    57) 
(lvls, us =        0,        0,        0, 0,        1)

After:
Concurrent Class Unloading   =    0.208 s (a =     3652 us) (n =    57) 
(lvls, us =     2559,     3281,     3457,     3965, 5780)
   Unlink Stale               =    0.190 s (a =     3340 us) (n =    57) 
(lvls, us =     2344,     2988,     3105,     3613, 5496)
     System Dictionary        =    0.001 s (a =       13 us) (n =    57) 
(lvls, us =        9,       11,       12,       13, 21)
     Weak Class Links         =    0.000 s (a =        0 us) (n =    57) 
(lvls, us =        0,        0,        0, 0,        1)
     Code Roots               =    0.190 s (a =     3326 us) (n =    57) 
(lvls, us =     2324,     2969,     3086,     3613, 5482)
   Rendezvous                 =    0.007 s (a =      129 us) (n =    57) 
(lvls, us =       80,      107,      117,      119, 253)
   Purge Unlinked             =    0.008 s (a =      146 us) (n =    57) 
(lvls, us =      107,      127,      146,      148, 260)
     Code Roots               =    0.008 s (a =      145 us) (n =    57) 
(lvls, us =      107,      127,      145,      148, 258)
     CLDG                     =    0.000 s (a =        0 us) (n =    57) 
(lvls, us =        0,        0,        0, 0,        1)
     Exception Caches         =    0.000 s (a =        0 us) (n =    57) 
(lvls, us =        0,        0,        0, 0,        0)


Test:
   hotspot_gc_shenandoah

Thanks,

-Zhengyu



More information about the hotspot-gc-dev mailing list