summaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorTejun Heo2013-11-29 16:42:59 +0100
committerTejun Heo2013-11-29 16:42:59 +0100
commitafb2bc14e1c989cf0635bd04edb5ff55b8c1c7bd (patch)
treef7b3984bb26c3230d96a726f1af68bf882175c6a /include/linux/cgroup.h
parentcgroup: remove cgroup_pidlist->use_count (diff)
downloadkernel-qcow2-linux-afb2bc14e1c989cf0635bd04edb5ff55b8c1c7bd.tar.gz
kernel-qcow2-linux-afb2bc14e1c989cf0635bd04edb5ff55b8c1c7bd.tar.xz
kernel-qcow2-linux-afb2bc14e1c989cf0635bd04edb5ff55b8c1c7bd.zip
cgroup: don't guarantee cgroup.procs is sorted if sane_behavior
For some reason, tasks and cgroup.procs guarantee that the result is sorted. This is the only reason this whole pidlist logic is necessary instead of just iterating through sorted member tasks. We can't do anything about the existing interface but at least ensure that such expectation doesn't exist for the new interface so that pidlist logic may be removed in the distant future. This patch scrambles the sort order if sane_behavior so that the output is usually not sorted in the new interface. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 5207c28c2402..50d8cc37498b 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -275,6 +275,9 @@ enum {
* - "tasks" is removed. Everything should be at process
* granularity. Use "cgroup.procs" instead.
*
+ * - "cgroup.procs" is not sorted. pids will be unique unless they
+ * got recycled inbetween reads.
+ *
* - "release_agent" and "notify_on_release" are removed.
* Replacement notification mechanism will be implemented.
*