The patch titled Subject: mm: mark all calls into the vmalloc subsystem as potentially sleeping has been added to the -mm tree. Its filename is mm-mark-all-calls-into-the-vmalloc-subsystem-as-potentially-sleeping.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-mark-all-calls-into-the-vmalloc-subsystem-as-potentially-sleeping.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-mark-all-calls-into-the-vmalloc-subsystem-as-potentially-sleeping.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/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Christoph Hellwig <hch@xxxxxx> Subject: mm: mark all calls into the vmalloc subsystem as potentially sleeping We will take a sleeping lock in later in this series, so this adds the proper safeguards. Link: http://lkml.kernel.org/r/1479474236-4139-9-git-send-email-hch@xxxxxx Signed-off-by: Christoph Hellwig <hch@xxxxxx> Tested-by: Jisheng Zhang <jszhang@xxxxxxxxxxx> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Cc: Joel Fernandes <joelaf@xxxxxxxxxx> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Cc: John Dias <joaodias@xxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmalloc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff -puN mm/vmalloc.c~mm-mark-all-calls-into-the-vmalloc-subsystem-as-potentially-sleeping mm/vmalloc.c --- a/mm/vmalloc.c~mm-mark-all-calls-into-the-vmalloc-subsystem-as-potentially-sleeping +++ a/mm/vmalloc.c @@ -365,7 +365,7 @@ static struct vmap_area *alloc_vmap_area BUG_ON(offset_in_page(size)); BUG_ON(!is_power_of_2(align)); - might_sleep_if(gfpflags_allow_blocking(gfp_mask)); + might_sleep(); va = kmalloc_node(sizeof(struct vmap_area), gfp_mask & GFP_RECLAIM_MASK, node); @@ -1037,6 +1037,8 @@ void vm_unmap_aliases(void) if (unlikely(!vmap_initialized)) return; + might_sleep(); + for_each_possible_cpu(cpu) { struct vmap_block_queue *vbq = &per_cpu(vmap_block_queue, cpu); struct vmap_block *vb; @@ -1080,6 +1082,7 @@ void vm_unmap_ram(const void *mem, unsig unsigned long addr = (unsigned long)mem; struct vmap_area *va; + might_sleep(); BUG_ON(!addr); BUG_ON(addr < VMALLOC_START); BUG_ON(addr > VMALLOC_END); @@ -1431,6 +1434,8 @@ struct vm_struct *remove_vm_area(const v { struct vmap_area *va; + might_sleep(); + va = find_vmap_area((unsigned long)addr); if (va && va->flags & VM_VM_AREA) { struct vm_struct *vm = va->vm; _ Patches currently in -mm which might be from hch@xxxxxx are mm-remove-free_unmap_vmap_area_noflush.patch mm-remove-free_unmap_vmap_area_addr.patch mm-refactor-__purge_vmap_area_lazy.patch mm-warn-about-vfree-from-atomic-context.patch mm-mark-all-calls-into-the-vmalloc-subsystem-as-potentially-sleeping.patch mm-turn-vmap_purge_lock-into-a-mutex.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html