GNU bug report logs - #64260
[PATCH] Use cgroups v2 file system

Previous Next

Package: guix-patches;

Reported by: Sam Lockart <sam <at> samlockart.com>

Date: Sat, 24 Jun 2023 06:24:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64260 in the body.
You can then email your comments to 64260 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#64260; Package guix-patches. (Sat, 24 Jun 2023 06:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sam Lockart <sam <at> samlockart.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 24 Jun 2023 06:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sam Lockart <sam <at> samlockart.com>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: [PATCH] Use cgroups v2 file system
Date: Sat, 24 Jun 2023 03:11:26 +0000
cgroup v2 is the next generation of the control groups API.
This patch replaces the cgroup v1 file system with the unified
cgroup v2 file system.

cgroup v2 allows for things like containerd/podman to run rootless containers and opens guix system up to running things like Kubernetes.

* gnu/system/file-systems.scm: Use cgroups v2 file system
---
 gnu/system/file-systems.scm | 27 +++++++--------------------
 1 file changed, 7 insertions(+), 20 deletions(-)

diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 0ff5a0dcf6..59e04bcecf 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -445,26 +445,13 @@ (define %immutable-store
     (flags '(read-only bind-mount no-atime))))
 
 (define %control-groups
-  (let ((parent (file-system
-                  (device "cgroup")
-                  (mount-point "/sys/fs/cgroup")
-                  (type "tmpfs")
-                  (check? #f))))
-    (cons parent
-          (map (lambda (subsystem)
-                 (file-system
-                   (device "cgroup")
-                   (mount-point (string-append "/sys/fs/cgroup/" subsystem))
-                   (type "cgroup")
-                   (check? #f)
-                   (options subsystem)
-                   (create-mount-point? #t)
-
-                   ;; This must be mounted after, and unmounted before the
-                   ;; parent directory.
-                   (dependencies (list parent))))
-               '("cpuset" "cpu" "cpuacct" "memory" "devices" "freezer"
-                 "blkio" "perf_event" "pids")))))
+  ;; The cgroup2 file system.
+  (list (file-system
+           (device "none")
+	   (mount-point "/sys/fs/cgroup")
+	   (type "cgroup2")
+	   (check? #f)
+	   (create-mount-point? #f))))
 
 (define %elogind-file-systems
   ;; We don't use systemd, but these file systems are needed for elogind,
-- 
2.39.2





Information forwarded to guix-patches <at> gnu.org:
bug#64260; Package guix-patches. (Wed, 05 Jul 2023 20:53:01 GMT) Full text and rfc822 format available.

Message #8 received at 64260 <at> debbugs.gnu.org (full text, mbox):

From: Brian Cully <bjc <at> spork.org>
To: Sam Lockart <sam <at> samlockart.com>
Cc: 64260 <at> debbugs.gnu.org
Subject: Re: bug#64260: [PATCH] Use cgroups v2 file system
Date: Wed, 05 Jul 2023 16:52:34 -0400
I've been running this patch for a few days with an elogind-based system
and haven't had any issues. This patch also fixes rootless podman with
elogind, which is very nice.

-bjc




Information forwarded to guix-patches <at> gnu.org:
bug#64260; Package guix-patches. (Wed, 02 Aug 2023 04:41:01 GMT) Full text and rfc822 format available.

Message #11 received at 64260 <at> debbugs.gnu.org (full text, mbox):

From: Hilton Chain <hako <at> ultrarare.space>
To: Brian Cully <bjc <at> spork.org>
Cc: Sam Lockart <sam <at> samlockart.com>, 64260 <at> debbugs.gnu.org
Subject: Re: [bug#64260] [PATCH] Use cgroups v2 file system
Date: Wed, 02 Aug 2023 12:39:35 +0800
Hi,

On Thu, 06 Jul 2023 04:52:34 +0800,
Brian Cully via Guix-patches via wrote:
>
> I've been running this patch for a few days with an elogind-based system
> and haven't had any issues. This patch also fixes rootless podman with
> elogind, which is very nice.
>
> -bjc

I'm not familiar with cgroup, but the current %control-groups is
a requirement for docker-shepherd-service:
--8<---------------cut here---------------start------------->8---
(shepherd-service
       (documentation "Docker daemon.")
       (provision '(dockerd))
       (requirement '(containerd
                      dbus-system
                      elogind
                      file-system-/sys/fs/cgroup/blkio
                      file-system-/sys/fs/cgroup/cpu
                      file-system-/sys/fs/cgroup/cpuset
                      file-system-/sys/fs/cgroup/devices
                      file-system-/sys/fs/cgroup/memory
                      file-system-/sys/fs/cgroup/pids
                      networking
                      udev))
--8<---------------cut here---------------end--------------->8---

Thanks




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Tue, 08 Aug 2023 15:09:02 GMT) Full text and rfc822 format available.

Notification sent to Sam Lockart <sam <at> samlockart.com>:
bug acknowledged by developer. (Tue, 08 Aug 2023 15:09:02 GMT) Full text and rfc822 format available.

Message #16 received at 64260-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Sam Lockart <sam <at> samlockart.com>
Cc: 64260-done <at> debbugs.gnu.org
Subject: Re: bug#64260: [PATCH] Use cgroups v2 file system
Date: Tue, 08 Aug 2023 17:08:26 +0200
Hello Sam,

Sam Lockart <sam <at> samlockart.com> skribis:

> cgroup v2 is the next generation of the control groups API.
> This patch replaces the cgroup v1 file system with the unified
> cgroup v2 file system.
>
> cgroup v2 allows for things like containerd/podman to run rootless containers and opens guix system up to running things like Kubernetes.
>
> * gnu/system/file-systems.scm: Use cgroups v2 file system

[...]

Hilton Chain <hako <at> ultrarare.space> skribis:

> I'm not familiar with cgroup, but the current %control-groups is
> a requirement for docker-shepherd-service:

Good point!  Finally applied, with the change Hilton suggested.

This passes just fine:

  make check-system TESTS="docker basic elogind"

Thanks,
Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 06 Sep 2023 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 6 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.