RFR: 8241427: Coarsen locking in Modules::add_module_exports

Harold Seigel harold.seigel at oracle.com
Wed Mar 25 17:48:43 UTC 2020


Hi Claes,

It looks like you removed this from modules.cpp.  Can you also remove it 
from modules.hpp?

    Modules::get_module(Symbol* package_name, Handle h_loader, TRAPS)

Otherwise, the change looks good.

Thanks, Harold


On 3/25/2020 12:23 PM, Claes Redestad wrote:
> Hi again,
>
> updated after offline discussion with Lois:
>
> http://cr.openjdk.java.net/~redestad/8241427/open.01
>
> - replaced package_entry->module() != module_entry checks with
>   an assert in get_locked_package_entry.
> - removed corresponding throwing of IAEs
> - refactored logic in add_module_exports_to_all_unnamed to be
>   similar to add_module_exports
>
> Thanks!
>
> /Claes
>
> On 2020-03-23 12:27, Claes Redestad wrote:
>> Hi,
>>
>> in some places we first lookup a PackageEntry - taking and releasing
>> Module_lock - only to then, after some trivial checks - take the
>> Module_lock again to update some state in the PackageEntry.
>>
>> Coarsening the locking so we only take the mutex once per call brings a
>> small improvement to bootstrap (reduction of ~200-250k instructions)
>>
>> Webrev: http://cr.openjdk.java.net/~redestad/8241427/open.00/
>> Bug:    https://bugs.openjdk.java.net/browse/JDK-8241427
>>
>> Testing: tier1-3
>>
>> Thanks!
>>
>> /Claes


More information about the hotspot-runtime-dev mailing list