]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
thp-clean-up-__collapse_huge_page_isolate v2
authorBob Liu <lliubbo@gmail.com>
Thu, 25 Oct 2012 01:14:48 +0000 (12:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 31 Oct 2012 05:49:45 +0000 (16:49 +1100)
mv label out of condition.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: Ni zhan Chen <nizhan.chen@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c

index 38fb9b1662e67ce5440fdd13b4667a291c8bbf42..36bed8342bd649972c91bb20dbd0fc8aa3ba6aa0 100644 (file)
@@ -1853,7 +1853,7 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma,
 {
        struct page *page;
        pte_t *_pte;
-       int referenced = 0, isolated = 1, none = 0;
+       int referenced = 0, none = 0;
        for (_pte = pte; _pte < pte+HPAGE_PMD_NR;
             _pte++, address += PAGE_SIZE) {
                pte_t pteval = *_pte;
@@ -1902,12 +1902,11 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma,
                    mmu_notifier_test_young(vma->vm_mm, address))
                        referenced = 1;
        }
-       if (unlikely(!referenced)) {
+       if (likely(referenced))
+               return 1;
 out:
-               release_pte_pages(pte, _pte);
-               isolated = 0;
-       }
-       return isolated;
+       release_pte_pages(pte, _pte);
+       return 0;
 }
 
 static void __collapse_huge_page_copy(pte_t *pte, struct page *page,