linux-stable/include/linux/sched
Vlastimil Babka 499118e966 mm: introduce memalloc_noreclaim_{save,restore}
The previous patch ("mm: prevent potential recursive reclaim due to
clearing PF_MEMALLOC") has shown that simply setting and clearing
PF_MEMALLOC in current->flags can result in wrongly clearing a
pre-existing PF_MEMALLOC flag and potentially lead to recursive reclaim.
Let's introduce helpers that support proper nesting by saving the
previous stat of the flag, similar to the existing memalloc_noio_* and
memalloc_nofs_* helpers.  Convert existing setting/clearing of
PF_MEMALLOC within mm to the new helpers.

There are no known issues with the converted code, but the change makes
it more robust.

Link: http://lkml.kernel.org/r/20170405074700.29871-3-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Suggested-by: Michal Hocko <mhocko@suse.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Chris Leech <cleech@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Josef Bacik <jbacik@fb.com>
Cc: Lee Duncan <lduncan@suse.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Richard Weinberger <richard@nod.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-05-08 17:15:15 -07:00
..
autogroup.h sched/headers: Remove <linux/sched.h> from <linux/sched/autogroup.h> 2017-03-03 01:45:29 +01:00
clock.h sched/clock, x86/perf: Fix "perf test tsc" 2017-03-23 07:31:49 +01:00
coredump.h sched/headers: Remove <linux/sched.h> from <linux/sched/coredump.h> 2017-03-03 01:45:30 +01:00
cpufreq.h sched/headers: Remove <linux/sched.h> from <linux/sched/cpufreq.h> 2017-03-03 01:45:32 +01:00
cputime.h sched/headers: Move cputime functionality from <linux/sched.h> and <linux/cputime.h> into <linux/sched/cputime.h> 2017-03-03 01:45:22 +01:00
deadline.h sched/headers: Make all include/linux/sched/*.h headers build standalone 2017-03-02 08:42:23 +01:00
debug.h sched/headers: Remove <linux/sched.h> from <linux/sched/debug.h> 2017-03-03 01:45:35 +01:00
hotplug.h sched/headers: Remove <linux/sched.h> from <linux/sched/hotplug.h> 2017-03-03 01:45:35 +01:00
idle.h sched/headers: Remove tsk_is_polling() 2017-03-03 01:45:27 +01:00
init.h sched/headers: Remove <linux/sched.h> from <linux/sched/init.h> 2017-03-03 01:45:38 +01:00
jobctl.h sched/headers: Move the JOBCTL_ defines and methods from <linux/sched.h> to <linux/sched/jobctl.h> 2017-03-03 01:43:41 +01:00
loadavg.h sched/headers: Remove <linux/sched.h> from <linux/sched/loadavg.h> 2017-03-03 01:45:28 +01:00
mm.h mm: introduce memalloc_noreclaim_{save,restore} 2017-05-08 17:15:15 -07:00
nohz.h sched/headers: Remove <linux/sched.h> from <linux/sched/nohz.h> 2017-03-03 01:45:35 +01:00
numa_balancing.h sched/headers: Move the NUMA balancing interfaces from <linux/sched.h> to <linux/sched/numa_balancing.h> 2017-03-03 01:43:40 +01:00
prio.h sched/headers: Make all include/linux/sched/*.h headers build standalone 2017-03-02 08:42:23 +01:00
rt.h sched/rtmutex: Refactor rt_mutex_setprio() 2017-04-04 11:44:06 +02:00
signal.h signal: Make kill_proc_info static 2017-04-21 22:46:25 -05:00
stat.h sched/headers: Remove <linux/sched.h> from <linux/sched/stat.h> 2017-03-03 01:45:34 +01:00
sysctl.h sched/headers: Make all include/linux/sched/*.h headers build standalone 2017-03-02 08:42:23 +01:00
task.h sched/headers: Move the sched_exec() prototype to <linux/sched/task.h> 2017-03-03 01:45:26 +01:00
task_stack.h sched/headers: Move kstack_end() from <linux/sched.h> to <linux/sched/task_stack.h> 2017-03-03 01:45:24 +01:00
topology.h sched/headers: Remove the <linux/topology.h> include from <linux/sched.h> 2017-03-03 01:45:41 +01:00
user.h sched/headers: Remove <linux/sched.h> from <linux/sched/user.h> 2017-03-03 01:45:30 +01:00
wake_q.h sched/headers: Move the wake-queue types and interfaces from sched.h into <linux/sched/wake_q.h> 2017-03-02 08:42:42 +01:00
xacct.h sched/headers: Move CONFIG_TASK_XACCT bits from <linux/sched.h> to <linux/sched/xacct.h> 2017-03-03 01:43:41 +01:00