[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251110-work-namespace-nstree-fixes-v1-0-e8a9264e0fb9@kernel.org>
Date: Mon, 10 Nov 2025 16:08:12 +0100
From: Christian Brauner <brauner@...nel.org>
To: linux-fsdevel@...r.kernel.org, Josef Bacik <josef@...icpanda.com>,
Jeff Layton <jlayton@...nel.org>
Cc: Jann Horn <jannh@...gle.com>, 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>,
Amir Goldstein <amir73il@...il.com>, Tejun Heo <tj@...nel.org>,
Johannes Weiner <hannes@...xchg.org>, Thomas Gleixner <tglx@...utronix.de>,
Alexander Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org, bpf@...r.kernel.org,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
netdev@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Christian Brauner <brauner@...nel.org>
Subject: [PATCH 00/17] ns: header cleanups and initial namespace reference
count improvements
Cleanup the namespace headers by splitting them into types and helpers.
Better separate common namepace types and functions from namespace tree
types and functions.
Fix the reference counts of initial namespaces so we don't do any
pointless cacheline ping-pong for them when we know they can never go
away. Add a bunch of asserts for both the passive and active reference
counts to catch any changes that would break it.
Signed-off-by: Christian Brauner <brauner@...nel.org>
---
Christian Brauner (17):
ns: move namespace types into separate header
nstree: decouple from ns_common header
nstree: move nstree types into separate header
nstree: add helper to operate on struct ns_tree_{node,root}
nstree: switch to new structures
nstree: simplify owner list iteration
nstree: use guards for ns_tree_lock
ns: make is_initial_namespace() argument const
ns: rename is_initial_namespace()
fs: use boolean to indicate anonymous mount namespace
ipc: enable is_ns_init_id() assertions
ns: make all reference counts on initial namespace a nop
ns: add asserts for initial namespace reference counts
ns: add asserts for initial namespace active reference counts
pid: rely on common reference count behavior
ns: drop custom reference count initialization for initial namespaces
selftests/namespaces: fix nsid tests
fs/mount.h | 3 +-
fs/namespace.c | 9 +-
include/linux/ns/ns_common_types.h | 196 ++++++++++++++++
include/linux/ns/nstree_types.h | 55 +++++
include/linux/ns_common.h | 266 +++++-----------------
include/linux/nstree.h | 38 ++--
include/linux/pid_namespace.h | 3 +-
init/version-timestamp.c | 2 +-
ipc/msgutil.c | 2 +-
ipc/namespace.c | 3 +-
kernel/cgroup/cgroup.c | 2 +-
kernel/nscommon.c | 15 +-
kernel/nstree.c | 304 ++++++++++++++-----------
kernel/pid.c | 2 +-
kernel/pid_namespace.c | 2 +-
kernel/time/namespace.c | 2 +-
kernel/user.c | 2 +-
tools/testing/selftests/namespaces/nsid_test.c | 107 +++++----
18 files changed, 576 insertions(+), 437 deletions(-)
---
base-commit: c9255cbe738098e46c9125c6b409f7f8f4785bf6
change-id: 20251110-work-namespace-nstree-fixes-f23931a00ba2
Powered by blists - more mailing lists