The patch titled Subject: arch/mips/mm/c-r4k.c: do not use mmap_sem for gup_fast() has been added to the -mm tree. Its filename is mips-c-r4k-do-no-use-mmap_sem-for-gup_fast.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mips-c-r4k-do-no-use-mmap_sem-for-gup_fast.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mips-c-r4k-do-no-use-mmap_sem-for-gup_fast.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: Davidlohr Bueso <dave@xxxxxxxxxxxx> Subject: arch/mips/mm/c-r4k.c: do not use mmap_sem for gup_fast() It is well known that because the mm can internally call the regular gup_unlocked if the lockless approach fails and take the sem there, the caller must not hold the mmap_sem already. Link: http://lkml.kernel.org/r/20190207053740.26915-3-dave@xxxxxxxxxxxx Fixes: e523f289fe4d ("MIPS: c-r4k: Fix sigtramp SMP call to use kmap") Signed-off-by: Davidlohr Bueso <dbueso@xxxxxxx> Cc: Ralf Baechle <ralf@xxxxxxxxxxxxxx> Cc: Paul Burton <paul.burton@xxxxxxxx> Cc: James Hogan <jhogan@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/arch/mips/mm/c-r4k.c~mips-c-r4k-do-no-use-mmap_sem-for-gup_fast +++ a/arch/mips/mm/c-r4k.c @@ -1034,11 +1034,9 @@ static void r4k_flush_cache_sigtramp(uns struct flush_cache_sigtramp_args args; int npages; - down_read(¤t->mm->mmap_sem); - npages = get_user_pages_fast(addr, 1, 0, &args.page); if (npages < 1) - goto out; + return; args.mm = current->mm; args.addr = addr; @@ -1046,8 +1044,6 @@ static void r4k_flush_cache_sigtramp(uns r4k_on_each_cpu(R4K_HIT, local_r4k_flush_cache_sigtramp, &args); put_page(args.page); -out: - up_read(¤t->mm->mmap_sem); } static void r4k_flush_icache_all(void) _ Patches currently in -mm which might be from dave@xxxxxxxxxxxx are mm-make-mm-pinned_vm-an-atomic64-counter.patch drivers-mic-scif-do-not-use-mmap_sem.patch drivers-ibqib-optimize-mmap_sem-usage.patch drivers-ibhfi1-do-not-se-mmap_sem.patch drivers-ibusnic-reduce-scope-of-mmap_sem.patch drivers-ibcore-reduce-scope-of-mmap_sem.patch xsk-do-not-use-mmap_sem.patch mips-c-r4k-do-no-use-mmap_sem-for-gup_fast.patch