Currently some OSContainer functions use direct CGroup V1 implementation details. This should be made more agnostic so as to accommodate for a future CGroup V2-based implementation (See JDK-8230305).
The proposal is dispatch to cgroup version agnostic implementations for the following functions:
static const char * container_type();
static jlong memory_limit_in_bytes();
static jlong memory_and_swap_limit_in_bytes();
static jlong memory_soft_limit_in_bytes();
static jlong memory_usage_in_bytes();
static jlong memory_max_usage_in_bytes();
static char * cpu_cpuset_cpus();
static char * cpu_cpuset_memory_nodes();
static int cpu_quota();
static int cpu_period();
static int cpu_shares();
This would allow for support for cgroup v2 without actually changing OSContainer code for those functions.
The proposal is dispatch to cgroup version agnostic implementations for the following functions:
static const char * container_type();
static jlong memory_limit_in_bytes();
static jlong memory_and_swap_limit_in_bytes();
static jlong memory_soft_limit_in_bytes();
static jlong memory_usage_in_bytes();
static jlong memory_max_usage_in_bytes();
static char * cpu_cpuset_cpus();
static char * cpu_cpuset_memory_nodes();
static int cpu_quota();
static int cpu_period();
static int cpu_shares();
This would allow for support for cgroup v2 without actually changing OSContainer code for those functions.