mm/swapfile: do not sleep with a spin lock held
authorQian Cai <qcai@redhat.com>
Sun, 6 Dec 2020 06:14:55 +0000 (22:14 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 6 Dec 2020 18:19:07 +0000 (10:19 -0800)
commitb11a76b37a5aa7b07c3e3eeeaae20b25475bddd3
tree136f50d4ee06d7b0fd281af91e43d0c6e7c86595
parente91d8d78237de8d7120c320b3645b7100848f24d
mm/swapfile: do not sleep with a spin lock held

We can't call kvfree() with a spin lock held, so defer it.  Fixes a
might_sleep() runtime warning.

Fixes: 873d7bcfd066 ("mm/swapfile.c: use kvzalloc for swap_info_struct allocation")
Signed-off-by: Qian Cai <qcai@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20201202151549.10350-1-qcai@redhat.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/swapfile.c