[jdk8u-dev] RFR: 8230305: Cgroups v2: Container awareness [v6]

Jonathan Dowland jdowland at openjdk.org
Tue Nov 1 10:57:31 UTC 2022


On Mon, 31 Oct 2022 14:42:41 GMT, Jonathan Dowland <jdowland at openjdk.org> wrote:

>> This is a backport of 8230305 (Cgroups v2: Container awareness) for JDK8u, working from the jdk11u-dev backport as part of an effort to backport cgroups v2 to jdk8u-dev.
>> 
>> The patch does not apply clean after unshuffling and path fixing:
>> 
>>  * mostly copyright line issues
>>  * different package name for jdk.test.lib.process.OutputAnalyzer
>>  * Most of hotspot/src/os/linux/vm/cgroupSubsystem_linux.cpp failed due to context changes, manually resolved (mostly deletions)
>> 
>> A few other changes were made
>> 
>>  *  Rework use of newer logging API (log_debug etc) to use guarded tty->print_cr
>>  *  replace os::strerror with the libc strerror (which is thread unsafe, but that should be addressed by backporting 8148425 separately)
>> 
>> patch touched hotspot/test/runtime/containers/docker/TestCPUAwareness.java which passes afterwards; I'm running further tests now (and awaiting GitHub CI doing the same)
>
> Jonathan Dowland has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 21 commits:
> 
>  - Remove C++11-style non-static member initialisation
>    
>    This causes issues with pre-C++11 compilers (of which jdk8u-dev
>    ostensibly supports). Issue has materialised on ARM32.
>    
>    I haven't introduced initialiser lists to the constructor because
>    all of these are assigned to in the body of the constructor.
>  - Guard two more tty->print_cr with PrintContainerInfo
>  - Whitespace and braces around PrintContainerInfo
>  - substitute os::strerror for strerror
>    
>    os::strerror was introduced in 8148425 (strerror() function is not
>    thread-safe), which is probably out of scope for backporting (at least
>    as part of this cgroups v2 effort). Replace uses of os::strerror with
>    (thread unsafe) strerror, in common with the rest of JDK8u.
>  - Rework use of newer logging API to tty->print_cr
>    
>    Remove includes of log.hpp that doesn't exist in jdk8u
>    
>    log_(debug|trace) to tty->print_cr guarded by PrintContainerInfo
>  - 8230305: Cgroups v2: Container awareness
>    
>    Implement Cgroups v2 container awareness in hotspot
>    
>    Reviewed-by: bobv, dholmes
>  - TestCgroupSubsystemController: rework use of Files.writeString
>  - CgroupSubsystemController: fix library paths
>    
>    We need the testlibrary copy of FileUtils but the test.lib.util copy of
>    Utils (method createTempDirectory is missing from the testlib copy)
>  - TestCgroupSubsystemController: fix jtreg @library path
>  - Replace Arrays.compare with Arrays.equals
>    
>    jdk8u does not have Arrays.compare()
>  - ... and 11 more: https://git.openjdk.org/jdk8u-dev/compare/f04ad96c...6947cdb7

After reparenting this PR to master last night, I've inadvertently pulled in the commits from the previous base (PR for 8231111). I'm working on filtering them out now.

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

PR: https://git.openjdk.org/jdk8u-dev/pull/127


More information about the jdk8u-dev mailing list