RFR: 8353558: x86: Use better instructions for ICache sync when available [v3]

Aleksey Shipilev shade at openjdk.org
Wed Apr 23 10:01:42 UTC 2025


On Thu, 17 Apr 2025 18:17:03 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> Is this assignment atomic? It is in `ICacheStubGenerator::generate_icache_flush()`:

Yes, it is access atomic pointer-wide store on x86. The nearest uses are in the same thread even, so there are no concurrency issues on the init path here. The store to global `AbstractICache::_flush_icache_stub` is not fenced, but then this is how most stub entry addresses are initialized: AFAICS, starting subsequent threads would sync up the "global" stub entry values.

> src/hotspot/share/runtime/icache.cpp line 36:
> 
>> 34: AbstractICache::flush_icache_stub_t AbstractICache::_flush_icache_stub = nullptr;
>> 35: 
>> 36: void AbstractICache::initialize(int phase) {
> 
> Please add comment explaining different phases.

Added. Also reshuffled a bit of code to make avoid unnecessary arch changes.

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

PR Comment: https://git.openjdk.org/jdk/pull/24389#issuecomment-2823754992
PR Review Comment: https://git.openjdk.org/jdk/pull/24389#discussion_r2055700151


More information about the hotspot-dev mailing list