The patch titled Subject: vfree, kvfree: add debug might_sleep()s has been added to the -mm tree. Its filename is vfree-kvfree-add-debug-might-sleeps.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/vfree-kvfree-add-debug-might-sleeps.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/vfree-kvfree-add-debug-might-sleeps.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Subject: vfree, kvfree: add debug might_sleep()s Add might_sleep() calls to vfree(), kvfree() to catch potential sleep-in-atomic bugs earlier. Link: http://lkml.kernel.org/r/20180914130512.10394-3-aryabinin@xxxxxxxxxxxxx Signed-off-by: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/util.c | 2 ++ mm/vmalloc.c | 2 ++ 2 files changed, 4 insertions(+) --- a/mm/util.c~vfree-kvfree-add-debug-might-sleeps +++ a/mm/util.c @@ -446,6 +446,8 @@ EXPORT_SYMBOL(kvmalloc_node); */ void kvfree(const void *addr) { + might_sleep_if(!in_interrupt()); + if (is_vmalloc_addr(addr)) vfree(addr); else --- a/mm/vmalloc.c~vfree-kvfree-add-debug-might-sleeps +++ a/mm/vmalloc.c @@ -1587,6 +1587,8 @@ void vfree(const void *addr) kmemleak_free(addr); + might_sleep_if(!in_interrupt()); + if (!addr) return; if (unlikely(in_interrupt())) _ Patches currently in -mm which might be from aryabinin@xxxxxxxxxxxxx are kvfree-fix-misleading-comment.patch mm-vmalloc-improve-vfree-kerneldoc.patch vfree-kvfree-add-debug-might-sleeps.patch