]> git.ipfire.org Git - thirdparty/linux.git/commit
pid: reorder fields in pid_namespace to reduce false sharing
authorMateusz Guzik <mjguzik@gmail.com>
Tue, 20 Jan 2026 20:48:20 +0000 (21:48 +0100)
committerChristian Brauner <brauner@kernel.org>
Tue, 10 Feb 2026 10:39:30 +0000 (11:39 +0100)
commit03aef0602f22f30aab0e42e7f3169b0a5920c461
tree6efcd58a0ca621360f756e90f216927813926193
parent802182490445f6bcf5de0e0518fb967c2afb6da1
pid: reorder fields in pid_namespace to reduce false sharing

alloc_pid() loads pid_cachep, level and pid_max prior to taking the
lock.

It dirties idr and pid_allocated with the lock.

Some of these fields share the cacheline as is, split them up.

No change in the size of the struct.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://patch.msgid.link/20260120204820.1497002-1-mjguzik@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/pid_namespace.h