unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Sam Lockart <sam@samlockart.com>
To: 64260@debbugs.gnu.org
Subject: [bug#64260] [PATCH] Use cgroups v2 file system
Date: Sat, 24 Jun 2023 03:11:26 +0000	[thread overview]
Message-ID: <hC7GiiLV5qxJ0WSDTRmDmy4V2wsy6yraRPcoC4UC2WAhEyNCb69vCjBYKYVHmF1NS65HyWYD-jBliH_Gq5LwAO_2WPlhqq2ekBWI0FYyFxc=@samlockart.com> (raw)

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





             reply	other threads:[~2023-06-24 14:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-24  3:11 Sam Lockart [this message]
2023-07-05 20:52 ` [bug#64260] [PATCH] Use cgroups v2 file system Brian Cully via Guix-patches via
2023-08-02  4:39   ` Hilton Chain via Guix-patches via
2023-08-08 15:08 ` bug#64260: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='hC7GiiLV5qxJ0WSDTRmDmy4V2wsy6yraRPcoC4UC2WAhEyNCb69vCjBYKYVHmF1NS65HyWYD-jBliH_Gq5LwAO_2WPlhqq2ekBWI0FYyFxc=@samlockart.com' \
    --to=sam@samlockart.com \
    --cc=64260@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).