RFR: 8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected [v2]
Severin Gehwolf
sgehwolf at openjdk.org
Wed Aug 28 08:46:19 UTC 2024
On Wed, 28 Aug 2024 07:37:22 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Because `CgroupUtil::adjust_controller(CgroupCpuController* cpu)` uses `os::Linux::active_processor_count()` for the host cpu value which is protected.
>
> Okay. I dislike friend a bit since it undermines C++ scope protection. Why not make os::Linux::active_processor_count public then? If its needed from outside the Linux namespace, it should be public.
>
> Side note, I assume we cannot just use `os::active_processor_count()` because it handles the containerized case, and what we really want here is the real physical count?
>
> Not for this RFE, but a bit cleaner may be if we had something like os::active_processor_count() - taking care of handling the ActiveProcessorCount switch and reporting container limits if containerized - and something like "os::active_physical_processor_count()" , which would report the real physical number.
I'd be happy to make `os::Linux::active_processor_count` public as part of this patch. Or add the `os::active_physical_processor_count()` api as you suggest. It would also make #19530 cleaner since it needs to know the host CPU values too. What would you like me to do here? How about keep as-is, then I'll file a new issue to clean this up by introducing `os::active_physical_processor_count()`?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20646#discussion_r1734256107
More information about the hotspot-runtime-dev
mailing list