RFR: 8378675: PPC64: increase instruction cache line size [v3]

Richard Reingruber rrich at openjdk.org
Fri Feb 27 09:21:22 UTC 2026


On Fri, 27 Feb 2026 07:04:06 GMT, David Briemann <dbriemann at openjdk.org> wrote:

>> Personally I don't like that. It means you have to check if a method really has a definitions on all platform flavours and versions (OS, libc, ...) before you can use them in shared code. That's just tedious.
>> And if there's enough laziness in the process of resolving references then only a user might find out that there's no definition for the users platform.
>
> The alternative was to use `os::Linux::get..()` and `os::Aix::get..()` but that requires wrapping these calls in ifdefs, which doesn't look so nice.
> 
> We could also add these functions for the other systems with an `uninplemented()` body but then they only fail at runtime. We thought failing at build/link time would be better.

The issue surely looks like a minor detail and this specific instance surely is. My concern is that if we deliberately add declarations without implementations on all platforms then it is only a question of time until the os interface becomes a mess.

Besides that it seems to be problematic to establish a shared interface for cache line sizes (see comments in [hotspot-style.md](https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md#additional-forbidden-features))

> The alternative was to use `os::Linux::get..()` and `os::Aix::get..()` but that requires wrapping these calls in ifdefs, which doesn't look so nice.

There are more alternatives.

Currently I think you should declare the methods in `class VM_Version` in `vm_version_ppc.hpp` It's a good fit since it holds informations about other cpu features too. Definitions can go to new `vm_version_$OS.cpp` files or to existing ones (`os_$OS.cpp`). I'd prefer the former, i.e. new files.

There's even more code in `vm_version_ppc.cpp` that depends on `#if defined(_AIX)` which could be moved.

> We could also add these functions for the other systems with an `uninplemented()` body but then they only fail at runtime. We thought failing at build/link time would be better.

Yeah, we shouldn't do that.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29918#discussion_r2863348380


More information about the hotspot-dev mailing list