RFR: 8254001: [Metrics] Enhance parsing of cgroup interface files for version detection
Severin Gehwolf
sgehwolf at openjdk.java.net
Mon Nov 23 15:55:10 UTC 2020
On Mon, 23 Nov 2020 15:46:56 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
> This is an enhancement which solves two issues:
>
> 1. Multiple reads of relevant cgroup interface files. Now interface files are only read once per file (just like Hotspot).
> 2. Proxies creation of the impl specific subsystem via `determineType()` as before, but now reads all relevant interface files: `/proc/cgroups`, `/proc/self/mountinfo` and `/proc/self/cgroup`. Once read it passes the parsed information to the impl specific subsystem classes for instantiation. This allows for more flexibility of testing as interface files can be mocked and, thus, more cases can be tested that way without having access to these specific systems. For example, proper regression tests for JDK-8217766 and JDK-8253435 have been added now with this in place.
>
> * [x] Tested on Linux x86_64 on cgroups v1 and cgroups v2. Container tests pass.
@poonamparhar Perhaps you want to take a look at this in the context of not regressing JDK-8255908? Thanks!
src/java.base/linux/classes/jdk/internal/platform/CgroupSubsystemFactory.java line 268:
> 266: info.setMountPoint(mountPath);
> 267: info.setMountRoot(mountRoot);
> 268: }
This is the actual fix of JDK-8253435 for the Java side.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1393
More information about the serviceability-dev
mailing list