summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShakeel Butt <shakeel.butt@linux.dev>2026-03-11 04:01:01 +0300
committerTejun Heo <tj@kernel.org>2026-03-12 01:16:21 +0300
commit4ef420b3450026b56807e5d53001f80eb495403c (patch)
tree032a895c6628d08085f3bcd31a9e68a403fc4f84 /include
parent4616120fca7f6d48b4c640e3975352e451e9c2ce (diff)
downloadlinux-4ef420b3450026b56807e5d53001f80eb495403c.tar.xz
cgroup: replace global cgroup_file_kn_lock with per-cgroup_file lock
Replace the global cgroup_file_kn_lock with a per-cgroup_file spinlock to eliminate cross-cgroup contention as it is not really protecting data shared between different cgroups. The lock is initialized in cgroup_add_file() alongside timer_setup(). No lock acquisition is needed during initialization since the cgroup directory is being populated under cgroup_mutex and no concurrent accessors exist at that point. Reported-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/cgroup-defs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
index bb92f5c169ca..ba26b5d05ce3 100644
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -167,6 +167,7 @@ struct cgroup_file {
struct kernfs_node *kn;
unsigned long notified_at;
struct timer_list notify_timer;
+ spinlock_t lock;
};
/*