RFR: 8367319: Add os interfaces to get machine and container values separately [v2]
David Holmes
dholmes at openjdk.org
Wed Oct 22 05:15:03 UTC 2025
On Tue, 21 Oct 2025 13:40:52 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:
> In other words - are you against the idea of having an implicit API that gives you either the container or the "machine"?
@fisk I am "against" trying to shoe-horn a poorly-defined legacy API into a dichotomy of "container value" versus "machine value". The concepts are not at all clean or well-defined for both variants.
> CPU quotas when running in a container.
Then you need an explicit API for that. No contortion of "available processors" is going to tell you what your quota is.
> The "machine" numbers when running in a container (which get overridden by container numbers).
Sounds simple but is it well-defined? Can you even ask the question (again I come back to available processors where sched_getaffinity will already account for the presence of the container if tasksets are used - what answer would you want for the "machine"?).
Aside: even if you can ask the question what use are these values if you are running within the container? Is there some means to bypass the container constraints?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27646#issuecomment-3430526062
More information about the hotspot-dev
mailing list