linux/Documentation/cgroups
Zefan Li 2ad654bc5e cpuset: PF_SPREAD_PAGE and PF_SPREAD_SLAB should be atomic flags
When we change cpuset.memory_spread_{page,slab}, cpuset will flip
PF_SPREAD_{PAGE,SLAB} bit of tsk->flags for each task in that cpuset.
This should be done using atomic bitops, but currently we don't,
which is broken.

Tetsuo reported a hard-to-reproduce kernel crash on RHEL6, which happened
when one thread tried to clear PF_USED_MATH while at the same time another
thread tried to flip PF_SPREAD_PAGE/PF_SPREAD_SLAB. They both operate on
the same task.

Here's the full report:
https://lkml.org/lkml/2014/9/19/230

To fix this, we make PF_SPREAD_PAGE and PF_SPREAD_SLAB atomic flags.

v4:
- updated mm/slab.c. (Fengguang Wu)
- updated Documentation.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Miao Xie <miaox@cn.fujitsu.com>
Cc: Kees Cook <keescook@chromium.org>
Fixes: 950592f7b9 ("cpusets: update tasks' page/slab spread flags in time")
Cc: <stable@vger.kernel.org> # 2.6.31+
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Zefan Li <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2014-09-24 22:16:06 -04:00
..
00-INDEX Documentation: cgroup: add documentation for net_cls cgroups. 2013-04-08 16:55:28 -04:00
blkio-controller.txt blk-throttle: implement proper hierarchy support 2013-05-14 13:52:38 -07:00
cgroups.txt cgroup: implement cgroup_subsys->css_reset() 2014-07-08 18:02:57 -04:00
cpuacct.txt Documentation: fix echo command in cgroups/cpuacct.txt 2011-07-23 10:58:08 -07:00
cpusets.txt cpuset: PF_SPREAD_PAGE and PF_SPREAD_SLAB should be atomic flags 2014-09-24 22:16:06 -04:00
devices.txt devcg: propagate local changes down the hierarchy 2013-03-20 07:50:21 -07:00
freezer-subsystem.txt cgroup_freezer: implement proper hierarchy support 2012-11-09 10:52:30 -08:00
hugetlb.txt hugetlb/cgroup: add HugeTLB controller documentation 2012-07-31 18:42:41 -07:00
memcg_test.txt mm: memcontrol: rewrite uncharge API 2014-08-08 15:57:17 -07:00
memory.txt Merge branch 'for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2014-06-09 15:03:33 -07:00
net_cls.txt netfilter: x_tables: lightweight process control group matching 2014-01-03 23:41:44 +01:00
net_prio.txt netprio_cgroup: allow nesting and inherit config on cgroup creation 2012-11-22 07:32:47 -08:00
resource_counter.txt res_counter: remove interface for locked charging and uncharging 2014-04-07 16:35:54 -07:00
unified-hierarchy.txt cgroup: distinguish the default and legacy hierarchies when handling cftypes 2014-07-15 11:05:10 -04:00