Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1513930 - RFE: rewrite cgroups code to support v2 subsystem
Summary: RFE: rewrite cgroups code to support v2 subsystem
Keywords:
Status: ASSIGNED
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.0
Assignee: Pavel Hrdina
QA Contact: yisun
URL:
Whiteboard:
Depends On: 1401552 1548266 1548268 1548272 1548274 1656432 1548276
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-16 10:04 UTC by Daniel Berrange
Modified: 2019-03-16 12:49 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1689297 (view as bug list)
Environment:
Last Closed:
Type: Feature Request


Attachments (Terms of Use)

Description Daniel Berrange 2017-11-16 10:04:56 UTC
Description of problem:
RHEL-8 intends to ship with the cgroups v2 subsystem enabled out of the box, instead of cgroups v1. While still based on a virtual filesystem, this has a quite significantly different design and is not compatible with what libvirt does for v1. We thus need to rewrite our code to allow it to support v2 as an alternative to v1.  This is a blocker for RHEL-8, because without this v2 support libvirt's resource mgmt will be dead in the water.

v2 is available in Fedora kernels, but is not enabled by default - it needs a special boot option to enable.

https://www.kernel.org/doc/Documentation/cgroup-v2.txt

See also previous thread at:

https://www.redhat.com/archives/libvir-list/2016-October/msg00921.html

NB, since that thread the kernel *has* merged a CPU controller for v2 that allows per-thread placement, so the major blocking item discussed there is resolved.

Version-Release number of selected component (if applicable):
3.9.0

Comment 1 Daniel Berrange 2017-11-30 13:40:29 UTC
NB, it occurred to me that it might be worth someone emailing Tejun at facebook, to find out if they did go ahead and implement libvirt cgroups v2 support out of tree as his mail suggested they might. If so they might be willing to contribute it back, at least as a starting point.

Comment 2 Jaroslav Suchanek 2018-03-27 19:53:19 UTC
The current requirement documented here:
https://docs.engineering.redhat.com/display/RHELPLAN/Support+control+group+v2

states:
* CGroup v1 will be the default behavior in RHEL8, for backward compatability reason. So far no containers, vms support cgroupv2 yet.
* All containers produced for RHEL7 and earlier will work on RHEL8. therefore, cgroupv1 will be the default cgroup to be mounted by default on RHEL8.

Still it is desirable feature for libvirt.

Comment 3 Daniel Berrange 2018-03-28 09:08:10 UTC
(In reply to Jaroslav Suchanek from comment #2)
> The current requirement documented here:
> https://docs.engineering.redhat.com/display/RHELPLAN/Support+control+group+v2
> 
> states:
> * CGroup v1 will be the default behavior in RHEL8, for backward
> compatability reason. So far no containers, vms support cgroupv2 yet.
> * All containers produced for RHEL7 and earlier will work on RHEL8.
> therefore, cgroupv1 will be the default cgroup to be mounted by default on
> RHEL8.
> 
> Still it is desirable feature for libvirt.

CGroup v2 is still going to be a fully supported part of RHEL-8 - just still defaulting to v1 out of the box. To be able to consider it fully supported, we need libvirt not to break, when an admin turns on v2, so this still looks like a blocking requirement for RHEL-8 GA wrt libvirt.

Comment 4 Karen Noel 2018-07-09 23:06:45 UTC
Pavel, What is the target upstream version for this feature? Is the work in progress upstream? Thanks.

Comment 5 Pavel Hrdina 2018-07-17 09:24:00 UTC
Hi Karen, I would like to finish it before next release (4.6.0) but I'll see how it will go.  The existing code needs some cleanup and I'm already working on it.

Comment 6 Karen Noel 2018-08-07 13:51:08 UTC
Libvirt and cgroupv2 is a blocker for RHEL 8.0. Otherwise, customers who use KVM cannot use cgroupv2, including Red Hat layered products. Thanks.

Comment 8 Karen Noel 2018-10-11 21:37:57 UTC
Pavel, Any update on cgroup v2 support? I see you posted v2 on Oct 5. Thanks.

[libvirt] [PATCH v2 00/53] implement cgroup v2 support

https://www.redhat.com/archives/libvir-list/2016-October/msg00921.html

Comment 11 Pavel Hrdina 2018-10-13 23:26:47 UTC
Hi Karen, so that patch series is pushed into upstream so libvirt is now able to work with cgroups v2.  However, there is still missing implementation for devices controller.  I already have some patches prepared but there are still some issues that needs to be solved before I post it to mailing list.


Note You need to log in before you can comment on or make changes to this bug.