[jdk16] RFR: 8259765: ZGC: Handle incorrect processor id reported by the operating system [v2]

Florian Weimer fweimer at redhat.com
Thu Jan 21 09:59:18 UTC 2021


* Per Liden:

> It wasn't my intention to claim that sysconf() _is_ the problem
> here. I just wanted to mention that it _might_ be sysconf() that is
> the problem. The reason I mentioned that is the because of how Docker
> behaves. If you give a Docker container 2 CPUs, sysconf() will still
> return the number of CPUs available on the host system, e.g. 8, and
> sched_getcpu() will in that case return numbers in the 0-7 range. Of
> course, this was just an observation, Docker and OpenVZ could do
> things differently here.

Other container run-times leave the affinity mask and /sys and /proc
unchanged.  The downside is that applications that scale with available
system resources need to be adapted individually.  The existing
replacement interfaces also appear to have poor performance in some
cases.  There is also no backwards compatibility for them.

  [linux] Experimental support for cgroup memory limits in container (ie
  Docker) environments
  <https://bugs.openjdk.java.net/browse/JDK-8170888>

  Linux os::available_memory re-reads cgroup configuration on every
  invocation
  <https://bugs.openjdk.java.net/browse/JDK-8232207>

  Cgroups v2: Container awareness
  <https://bugs.openjdk.java.net/browse/JDK-8230305>

So it's fair to say that this is an area where there are no simple
solutions.  I would like to enhance glibc's sysconf so that it provides
the right results even in container environments, but it may not be the
right thing to do because it could be easier to adopt applications to
cgroups v3, v4, … than to upgrade glibc on old operating system versions
to add future cgroups version support (because that's feature
development, and that is supposed to cease at a certain point in the
maintainance cycle, right when conservative users start deploying that
version …).

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill




More information about the hotspot-gc-dev mailing list