-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
The Linux kernel includes a feature called "cgroup" (or "cgroups"). This allows managing - specially limiting - resources (cpu, memory, etc) for a collection of processes. This is one of the underlying technology pieces used by projects like docker, podman, kubernetes and systemd to limit various resources for processes.
The first version of cgroup has a number of design issues and a redesign, cgroup v2, was implemented in the Linux kernel. There are a number of incompatibilities between cgroup v1 and cgroup v2.
Complete documentation of cgroup v2 is available here: https://www.kernel.org/doc/Documentation/cgroup-v2.txt
Both cgroup v1 and cgroup v2 may be enabled on a system at the same time. Container runtimes (podman, docker) will only use one.
Some Linux distributions, such as Fedora, are starting to switch to cgroup v2 as the default: https://fedoraproject.org/wiki/Changes/CGroupsV2. Even where it's not the default, adding systemd.unified-cgroup-hierarchy=1 to the kernel command can be used to make it the default for testing.
A technique to disambiguate between cgroup v1 and cgroup v2 is documented here: https://systemd.io/CGROUP_DELEGATION/#three-different-tree-setups-
Currently, .NET Core doesn't support cgroup v2. This issue is for tracking the changes/fixes required across the different .NET Components.
CoreCLR:
- Add cgroup v2 support to PAL's
cgroup.cppand gc'scgroup.cpp: Add cgroup v2 support to coreclr #34334 (originally Add cgroup v2 support to CoreCLR coreclr#25906, but not merged due to repo move)
CoreFx:
- Fix reading the memory limit in
Interop.cgroups.cs: Add cgroup v2 support to Interop.cgroups corefx#39686 - Fix
cgroup2fsin the file system information inInterop.MountPoints.FormatInfo.cs: Fix up cgroup2fs in Interop.MountPoints.FormatInfo corefx#39633 - Sync cgroup v2 implementation in corefx with that in coreclr: Sync cgroup v2 in libraries with coreclr #34665