Files
i2som-imx-linux/include/linux
Zefan Li eb33a02fdd cpuset: PF_SPREAD_PAGE and PF_SPREAD_SLAB should be atomic flags
commit 2ad654bc5e 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.

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>
[lizf: Backported to 3.4:
 - adjust context
 - check current->flags & PF_MEMPOLICY rather than current->mempolicy]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2017-10-12 15:27:22 +01:00
..
2016-08-22 22:37:11 +01:00
2016-04-01 01:54:32 +01:00
2011-10-26 15:43:25 -04:00
2013-09-10 01:57:27 +01:00
2011-09-27 09:25:02 +01:00
2014-12-14 16:23:48 +00:00
2011-08-25 16:25:33 -07:00
2011-11-07 23:54:53 +01:00
2011-10-31 20:19:04 +00:00
2012-02-29 16:31:24 -08:00
2011-09-14 15:24:51 -04:00
2017-02-23 03:51:05 +00:00
2013-01-03 03:32:57 +00:00
2011-11-23 11:33:07 +01:00
2013-03-06 03:23:57 +00:00
2013-08-02 22:14:47 +02:00
2012-08-10 00:11:14 +01:00
2011-09-27 18:08:04 +02:00
2012-07-25 04:11:19 +01:00
2015-05-09 23:16:12 +01:00
2013-03-06 03:24:27 +00:00
2013-04-25 20:25:38 +01:00
2011-09-16 19:20:20 -04:00
2012-10-10 03:30:45 +01:00
2017-07-02 17:12:47 +01:00
2013-07-27 05:34:29 +01:00
2016-04-01 01:54:31 +01:00
2011-10-31 14:03:22 +01:00
2012-01-25 16:13:17 -08:00
2012-02-06 09:41:06 -08:00
2011-11-22 16:37:01 -05:00
2011-11-02 16:07:02 -07:00
2014-07-11 13:33:35 +01:00
2011-11-29 11:59:50 +00:00
2017-09-15 18:30:50 +01:00
2014-08-06 18:07:42 +01:00
2013-01-16 01:13:25 +00:00
2012-07-12 04:31:59 +01:00
2011-10-31 17:30:44 -07:00
2011-11-02 16:07:02 -07:00
2015-02-20 00:49:37 +00:00
2011-10-03 14:01:21 -04:00
2011-08-23 10:10:38 -07:00
2011-11-02 16:07:02 -07:00
2011-09-14 15:24:51 -04:00