RFR: 8339573: Update CodeCacheSegmentSize and CodeEntryAlignment for ARM
Evgeny Astigeevich
eastigeevich at openjdk.org
Thu Oct 3 22:25:36 UTC 2024
On Mon, 16 Sep 2024 18:13:25 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:
>>> > @vnkozlov Many thanks! Do you reproduce the regression on a public benchmark that I can also try? Now I restrict CodeEntryAlignment=16 for V1 and V2 only. And I restart my performance tests.
>>>
>>> This may have as much to do with the smallish icache
>>
>> Sorry, I meant last level cache
>
> @theRealAph
>> It makes little sense to set the default CodeEntryAlignment to less than the icache line size. except in severely constrained environments.
>
> Why do we need CodeEntryAlignment? The instruction prefetcher has more time to load the next cache line if execution starts at the beginning of the current cache line. But this consideration makes more sense for OptoLoopAlignment. Ideally, the entire loop body fits into a limited number of instruction cache lines - this is unlikely to happen with the entire nmethod body.
>
> I have experimented with code entry alignment on native application (repeatedly calling a large number of aligned/unaligned short methods) and found that for Neoverse N2 CPU 64-byte alignment is preferable, while no difference was observed for Neoverse V2. I am not sure if this is a feature of the processor implementation or a feature of the Neoverse architecture. The Neoverse N2/V2 technical reference manuals are pretty much the same about L1 instruction memory system features.
@bulasevich, @theRealAph, @vnkozlov
I see that gcc uses "32:16" for all neoverses.
This is aligned with what I found in the Neoverse-N1 Optimization Guide:
> Consider aligning subroutine entry points and branch targets to 32B boundaries, within the bounds of the code-density requirements of the program. This will ensure that the subsequent fetch can maximize bandwidth following the taken branch by bringing in all useful instructions
It is interesting that I don't see this in the N2&V1&V2 Optimization guides.
IMO we should consider setting CodeEntryAlignmentto for Neoverses to 32 and keep 64 for others.
Any objections?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20864#issuecomment-2392440723
More information about the hotspot-dev
mailing list