linux-stable/include/linux/sched
Omar Sandoval 93781325da lockdep: fix fs_reclaim annotation
While revisiting my Btrfs swapfile series [1], I introduced a situation
in which reclaim would lock i_rwsem, and even though the swapon() path
clearly made GFP_KERNEL allocations while holding i_rwsem, I got no
complaints from lockdep.  It turns out that the rework of the fs_reclaim
annotation was broken: if the current task has PF_MEMALLOC set, we don't
acquire the dummy fs_reclaim lock, but when reclaiming we always check
this _after_ we've just set the PF_MEMALLOC flag.  In most cases, we can
fix this by moving the fs_reclaim_{acquire,release}() outside of the
memalloc_noreclaim_{save,restore}(), althought kswapd is slightly
different.  After applying this, I got the expected lockdep splats.

1: https://lwn.net/Articles/625412/

Link: http://lkml.kernel.org/r/9f8aa70652a98e98d7c4de0fc96a4addcee13efe.1523778026.git.osandov@fb.com
Fixes: d92a8cfcb3 ("locking/lockdep: Rework FS_RECLAIM annotation")
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-06-07 17:34:35 -07:00
..
autogroup.h
clock.h
coredump.h
cpufreq.h sched/cpufreq: Provide migration hint 2018-03-09 07:59:20 +01:00
cputime.h
deadline.h sched/headers: Simplify and clean up header usage in the scheduler 2018-03-04 12:39:29 +01:00
debug.h
hotplug.h
idle.h
init.h
isolation.h sched/isolation: Isolate workqueues when "nohz_full=" is set 2018-02-21 09:49:08 +01:00
jobctl.h
loadavg.h
mm.h lockdep: fix fs_reclaim annotation 2018-06-07 17:34:35 -07:00
nohz.h sched/nohz: Clean up nohz enter/exit 2018-03-09 07:59:19 +01:00
numa_balancing.h
prio.h
rt.h
signal.h sched/core: Introduce set_special_state() 2018-05-04 07:54:54 +02:00
stat.h
sysctl.h
task.h
task_stack.h
topology.h
user.h efivarfs: Limit the rate for non-root to read files 2018-02-22 10:21:02 -08:00
wake_q.h
xacct.h