[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <wx455y2gvdfkpg34r5apf3kzgj4yu6x2s45vgvrjitlgyayrum@lhrpijrvkmpm>
Date: Mon, 15 Sep 2025 13:53:05 +0200
From: Jan Kara <jack@...e.cz>
To: Christian Brauner <brauner@...nel.org>
Cc: Jan Kara <jack@...e.cz>, Amir Goldstein <amir73il@...il.com>,
linux-fsdevel@...r.kernel.org, Josef Bacik <josef@...icpanda.com>,
Jeff Layton <jlayton@...nel.org>, Mike Yuan <me@...dnzj.com>,
Zbigniew Jędrzejewski-Szmek <zbyszek@...waw.pl>, Lennart Poettering <mzxreary@...inter.de>,
Daan De Meyer <daan.j.demeyer@...il.com>, Aleksa Sarai <cyphar@...har.com>,
Alexander Viro <viro@...iv.linux.org.uk>, Jens Axboe <axboe@...nel.dk>, Tejun Heo <tj@...nel.org>,
Johannes Weiner <hannes@...xchg.org>, Michal Koutný <mkoutny@...e.com>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
Chuck Lever <chuck.lever@...cle.com>, linux-nfs@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH v2 19/33] cgroup: support ns lookup
On Fri 12-09-25 13:52:42, Christian Brauner wrote:
> Support the generic ns lookup infrastructure to support file handles for
> namespaces.
>
> Acked-by: Tejun Heo <tj@...nel.org>
> Signed-off-by: Christian Brauner <brauner@...nel.org>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@...e.cz>
Honza
> ---
> kernel/cgroup/cgroup.c | 2 ++
> kernel/cgroup/namespace.c | 7 +++++--
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
> index 312c6a8b55bb..092e6bf081ed 100644
> --- a/kernel/cgroup/cgroup.c
> +++ b/kernel/cgroup/cgroup.c
> @@ -59,6 +59,7 @@
> #include <linux/sched/cputime.h>
> #include <linux/sched/deadline.h>
> #include <linux/psi.h>
> +#include <linux/nstree.h>
> #include <net/sock.h>
>
> #define CREATE_TRACE_POINTS
> @@ -6312,6 +6313,7 @@ int __init cgroup_init(void)
> WARN_ON(register_filesystem(&cpuset_fs_type));
> #endif
>
> + ns_tree_add(&init_cgroup_ns);
> return 0;
> }
>
> diff --git a/kernel/cgroup/namespace.c b/kernel/cgroup/namespace.c
> index 0391b6ab0bf1..fc12c416dfeb 100644
> --- a/kernel/cgroup/namespace.c
> +++ b/kernel/cgroup/namespace.c
> @@ -5,7 +5,7 @@
> #include <linux/slab.h>
> #include <linux/nsproxy.h>
> #include <linux/proc_ns.h>
> -
> +#include <linux/nstree.h>
>
> /* cgroup namespaces */
>
> @@ -30,16 +30,19 @@ static struct cgroup_namespace *alloc_cgroup_ns(void)
> ret = ns_common_init(&new_ns->ns, &cgroupns_operations, true);
> if (ret)
> return ERR_PTR(ret);
> + ns_tree_add(new_ns);
> return no_free_ptr(new_ns);
> }
>
> void free_cgroup_ns(struct cgroup_namespace *ns)
> {
> + ns_tree_remove(ns);
> put_css_set(ns->root_cset);
> dec_cgroup_namespaces(ns->ucounts);
> put_user_ns(ns->user_ns);
> ns_free_inum(&ns->ns);
> - kfree(ns);
> + /* Concurrent nstree traversal depends on a grace period. */
> + kfree_rcu(ns, ns.ns_rcu);
> }
> EXPORT_SYMBOL(free_cgroup_ns);
>
>
> --
> 2.47.3
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists