RFR: 8339148: Add os::active_physical_processor_count() API

Severin Gehwolf sgehwolf at openjdk.org
Thu Aug 29 16:34:50 UTC 2024


Please review this rather trivial patch for adding `os::active_physical_processor_count()` function. It is useful to have that info on Linux for the container code which bounds the CPU limit above by that value. Also, the old `os::Linux::active_processor_count()` was protected and had a bit of a misleading name. As a bonus, we can get rid of some `friend class` smells.

**Testing**:
- [x] GHA
- [x] Container tests and cgroup gtests on linux x86_64

Thoughts?

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

Commit messages:
 - physical_active_processor_count() => active_physical_processor_count()
 - Remove not-needed include
 - 8339148: Add os::active_physical_processor_count() API

Changes: https://git.openjdk.org/jdk/pull/20768/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20768&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8339148
  Stats: 25 lines in 6 files changed: 18 ins; 3 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/20768.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20768/head:pull/20768

PR: https://git.openjdk.org/jdk/pull/20768


More information about the hotspot-runtime-dev mailing list