From patchwork Sat Jun 24 03:11:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Lockart X-Patchwork-Id: 51258 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3DF6627BBEA; Sat, 24 Jun 2023 15:50:03 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2D3B827BBE2 for ; Sat, 24 Jun 2023 15:50:02 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qD4aG-0002Cz-IO; Sat, 24 Jun 2023 10:49:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCwgm-0003NT-HO for guix-patches@gnu.org; Sat, 24 Jun 2023 02:24:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCwgl-0003Ey-1q for guix-patches@gnu.org; Sat, 24 Jun 2023 02:24:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qCwgk-0001n8-Ia for guix-patches@gnu.org; Sat, 24 Jun 2023 02:24:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64260] [PATCH] Use cgroups v2 file system Resent-From: Sam Lockart Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 24 Jun 2023 06:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64260 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64260@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.16875878226845 (code B ref -1); Sat, 24 Jun 2023 06:24:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Jun 2023 06:23:42 +0000 Received: from localhost ([127.0.0.1]:39862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCwgM-0001mB-G0 for submit@debbugs.gnu.org; Sat, 24 Jun 2023 02:23:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:56710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCtgq-0004YU-Pm for submit@debbugs.gnu.org; Fri, 23 Jun 2023 23:11:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCtgq-0006Gm-Ju for guix-patches@gnu.org; Fri, 23 Jun 2023 23:11:56 -0400 Received: from mail-40136.proton.ch ([185.70.40.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCtgg-0008IT-At for guix-patches@gnu.org; Fri, 23 Jun 2023 23:11:56 -0400 Date: Sat, 24 Jun 2023 03:11:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samlockart.com; s=protonmail2; t=1687576301; x=1687835501; bh=Xo9TqYBC9v5ulYBeHZi5qgUqOj2eJZz0ZpKU8OOMmJQ=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=QwMznNE9YYowPl2xVRfGAv+8RPpIciDm+o2HCYzhFsv/voT6HHHf4HX+n+hD6VLtH RsBvQwh6IK6JOxiaK3ugHZIhzdLKIQXjEu5g2USJd0zITk3Cfa8E/zssoWvWFOfHNq ct9Fi/Gs4Vq7/aeSQFl+m4eW/Ti6E69bJ8HpqVN/GYIwRo9O/hTGIQigkaXkzMawq1 Z6yuvjWiB9VUtuZVgAerSy5KapQ1YjAwrmLi7fiaD2dmWqTmY3451q5J/G5diJPMby uaiYPfU4OwXqorI38UtgzwgrbmYQAoJofDEGm5LmRjyN4McFKDPiTxLQuXmUlsE9+7 bJf5oDu8ReZGA== From: Sam Lockart Message-ID: Feedback-ID: 30567524:user:proton MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.40.136; envelope-from=sam@samlockart.com; helo=mail-40136.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 24 Jun 2023 02:23:36 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sat, 24 Jun 2023 10:49:49 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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,