RFR: 8303210: [linux, Windows] Make UseSystemMemoryBarrier available as product flag [v5]

David Holmes dholmes at openjdk.org
Wed Mar 29 00:09:36 UTC 2023


On Tue, 28 Mar 2023 09:45:10 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> I'd like to enable UseSystemMemoryBarrier by default on supported Operating Systems in order to improve performance of thread state transitions (I/O, JNI, foreign function calls, JIT compiler threads, etc.). See JBS issue for more details.
>> Unfortunately, the feature was not yet implemented on all platforms. I added the code, but need the platform maintainers to check if it can be used reliably (and ideally if the performance improves). It's easy to switch it off again in case of problems.
>> 
>> Update: Startup performance and some benchmarks on some platforms are impacted (see below). So, this PR no longer switches it on by default.
>
> Martin Doerr has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Move flag configuration and initialization to os::init_2.

Approval in principal, but the initialization code needs fixing up.

> Note: The feature requires at least Linux 4.14. The flag needs to be off for older versions. 

In that case we should do a version check when trying to initialize, and at least warn if the OS is too old.

Thanks

src/hotspot/os/aix/os_aix.cpp line 2228:

> 2226:   if (UseSystemMemoryBarrier) {
> 2227:     if (!SystemMemoryBarrier::initialize()) {
> 2228:       if (!FLAG_IS_DEFAULT(UseSystemMemoryBarrier)) {

Have we processed this flag by this stage?

src/hotspot/os/aix/os_aix.cpp line 2348:

> 2346:     }
> 2347:     FLAG_SET_ERGO(UseSystemMemoryBarrier, false);
> 2348:   }

This looks like a leftover ?? It shouldn't be here.

-------------

Changes requested by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/12753#pullrequestreview-1362077036
PR Review Comment: https://git.openjdk.org/jdk/pull/12753#discussion_r1151266939
PR Review Comment: https://git.openjdk.org/jdk/pull/12753#discussion_r1151267317


More information about the hotspot-dev mailing list