cgroup: don't guarantee cgroup.procs is sorted if sane_behavior
authorTejun Heo <tj@kernel.org>
Fri, 29 Nov 2013 15:42:59 +0000 (10:42 -0500)
committerTejun Heo <tj@kernel.org>
Fri, 29 Nov 2013 15:42:59 +0000 (10:42 -0500)
commitafb2bc14e1c989cf0635bd04edb5ff55b8c1c7bd
treef7b3984bb26c3230d96a726f1af68bf882175c6a
parent045023658ca1e30dc0bb1f148b42c95b740d3e02
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>
include/linux/cgroup.h
kernel/cgroup.c