android_kernel_samsung_msm8976/Documentation/cgroups
Zefan Li bbc314da7d cpuset: PF_SPREAD_PAGE and PF_SPREAD_SLAB should be atomic flags
commit 2ad654bc5e2b211e92f66da1d819e47d79a866f0 upstream.

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.

Change-Id: I4eef89f5d91eaa2e7e677e662133a7856909a13f
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")
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 21:44:59 +02:00
..
00-INDEX Documentation: cgroup: add documentation for net_cls cgroups. 2013-04-08 16:55:28 -04:00
blkio-controller.txt Merge branch 'for-3.9/core' of git://git.kernel.dk/linux-block 2013-02-28 12:52:24 -08:00
cgroups.txt cgroup: Add generic cgroup subsystem permission checks 2013-07-01 13:38:49 -07:00
cpuacct.txt
cpusets.txt cpuset: PF_SPREAD_PAGE and PF_SPREAD_SLAB should be atomic flags 2019-07-27 21:44:59 +02: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 cgroups: move cgroup_event_listener.c to tools/cgroup 2013-01-07 09:41:28 -08:00
memory.txt mm, memcg: add rss_huge stat to memory.stat 2013-05-07 18:38:26 -07:00
net_cls.txt Documentation: cgroup: add documentation for net_cls cgroups. 2013-04-08 16:55:28 -04: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: return amount of charges after res_counter_uncharge() 2012-12-18 15:02:12 -08:00