RFR: Parallelize safepoint cleanup

Tobias Hartmann tobias.hartmann at oracle.com
Thu Jul 6 10:14:26 UTC 2017


On 05.07.2017 20:30, Daniel D. Daugherty wrote:
> JDK-8132849 is assigned to Tobias; it would be good to get Tobias'
> review of this fix also.

Thanks for the notification. The sweeper/safepoint changes look good to me!

> src/share/vm/runtime/sweeper.cpp
>     L205:     // TODO: Is this really needed?
>     L206:     OrderAccess::storestore();
>         That's a good question. Looks like that storestore() was
>         added by this changeset:
>         $ hg log -r 5357 src/share/vm/runtime/sweeper.cpp
>         changeset:   5357:510fbd28919c
>         user:        anoll
>         date:        Fri Sep 27 10:50:55 2013 +0200
>         summary:     8020151: PSR:PERF Large performance regressions when code cache is filled
>         The changeset is not small and it looks like two
>         OrderAccess::storestore() calls were added (and one
>         load_ptr_acquire() was deleted):
>         $ hg diff -r 5356 -r 5357 | grep OrderAccess
>         +      OrderAccess::storestore();
>         -  nmethod *code = (nmethod *)OrderAccess::load_ptr_acquire(&_code);
>         +  OrderAccess::storestore();
>         It could be that the storestore() is matching an existing
>         OrderAccess operation or it could have been added in an
>         abundance of caution. We definitely need a Compiler team
>         person to take a look here.

Unfortunately, I'm also not sure if that barrier is required. Looking at the old RFR thread:

It seems that Igor V. suggested this:
"You definitely need a store-store barrier for non-TSO architectures after the mark_as_seen_on_stack() call on line 1360. Otherwise it still can be reordered by the CPU with respect to the following state assignment. Also neither of these state variables are volatile in nmethod, so even the compiler may reorder the stores."

The requested OrderAccess::storestore() was added to nmethod::make_not_entrant_or_zombie() but seems like Albert also added one to NMethodSweeper::mark_active_nmethods().

I'll ping Igor, maybe he knows more.


More information about the hotspot-gc-dev mailing list