aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorYi Tao <escape@linux.alibaba.com>2025-09-10 14:59:33 +0800
committerTejun Heo <tj@kernel.org>2025-09-10 07:26:15 -1000
commita1ffc8ad3165fa1cf6a60c6a4b4e00dfd6603cf2 (patch)
tree5b595ec5e5c0a1a30aae26e0847c1e42af657634 /include
parentcgroup: Merge branch 'for-6.17-fixes' into for-6.18 (diff)
downloadlinux-a1ffc8ad3165fa1cf6a60c6a4b4e00dfd6603cf2.tar.gz
linux-a1ffc8ad3165fa1cf6a60c6a4b4e00dfd6603cf2.zip
cgroup: refactor the cgroup_attach_lock code to make it clearer
Dynamic cgroup migration involving threadgroup locks can be in one of two states: no lock held, or holding the global lock. Explicitly declaring the different lock modes to make the code easier to understand and facilitates future extensions of the lock modes. Signed-off-by: Yi Tao <escape@linux.alibaba.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/cgroup-defs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
index 92ed6d18266d..ff3c7d0e3e01 100644
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -140,6 +140,14 @@ enum {
__CFTYPE_ADDED = (1 << 18),
};
+enum cgroup_attach_lock_mode {
+ /* Default */
+ CGRP_ATTACH_LOCK_GLOBAL,
+
+ /* When pid=0 && threadgroup=false, see comments in cgroup_procs_write_start */
+ CGRP_ATTACH_LOCK_NONE,
+};
+
/*
* cgroup_file is the handle for a file instance created in a cgroup which
* is used, for example, to generate file changed notifications. This can