From 08abbb8a4ce640492312d98dc7faf853409ecdfa Mon Sep 17 00:00:00 2001 From: Bob Liu Date: Thu, 25 Oct 2012 12:14:48 +1100 Subject: [PATCH] thp-clean-up-__collapse_huge_page_isolate v2 mv label out of condition. Signed-off-by: Bob Liu Cc: Andrea Arcangeli Cc: Michal Hocko Cc: Minchan Kim Cc: Ni zhan Chen Signed-off-by: Andrew Morton --- mm/huge_memory.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 20037114297a..e3bbc651b522 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -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, -- 2.39.5