]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: remove lock validation check for MADV_FREE
authorMinchan Kim <minchan@kernel.org>
Wed, 21 Oct 2015 22:03:46 +0000 (09:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 Oct 2015 22:03:46 +0000 (09:03 +1100)
Currently, madvise_free_pte_range is called only madvise path which
already holds an mmap_sem so it's pointless to add the lock validation
check.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/madvise.c

index a9ca6d2fd22078186781a183666c3ace8b9d1acf..77f4611c98a8446d31e83bff22d7512970e638b7 100644 (file)
@@ -274,18 +274,9 @@ static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr,
 
        next = pmd_addr_end(addr, end);
        if (pmd_trans_huge(*pmd)) {
-               if (next - addr != HPAGE_PMD_SIZE) {
-#ifdef CONFIG_DEBUG_VM
-                       if (!rwsem_is_locked(&mm->mmap_sem)) {
-                               pr_err("%s: mmap_sem is unlocked! addr=0x%lx end=0x%lx vma->vm_start=0x%lx vma->vm_end=0x%lx\n",
-                                       __func__, addr, end,
-                                       vma->vm_start,
-                                       vma->vm_end);
-                               BUG();
-                       }
-#endif
+               if (next - addr != HPAGE_PMD_SIZE)
                        split_huge_pmd(vma, addr, pmd);
-               else if (!madvise_free_huge_pmd(tlb, vma, pmd, addr))
+               else if (!madvise_free_huge_pmd(tlb, vma, pmd, addr))
                        goto next;
                /* fall through */
        }