From: Andrew Morton Date: Wed, 28 Sep 2011 00:50:14 +0000 (+1000) Subject: thp-mremap-support-and-tlb-optimization-fix X-Git-Tag: next-20110929~2^2~162 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=10c6e9f8473b9db94c1965ec5cd06420fff5c86b;p=karo-tx-linux.git thp-mremap-support-and-tlb-optimization-fix coding-style nitpicking Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Johannes Weiner Cc: Mel Gorman Cc: Rik van Riel Signed-off-by: Andrew Morton <> --- diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 7c9ab4da1e6a..b975dc1db24f 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1065,15 +1065,14 @@ int move_huge_pmd(struct vm_area_struct *vma, struct vm_area_struct *new_vma, if ((old_addr & ~HPAGE_PMD_MASK) || (new_addr & ~HPAGE_PMD_MASK) || (old_addr + HPAGE_PMD_SIZE) > old_end || - new_vma->vm_flags & VM_NOHUGEPAGE) + (new_vma->vm_flags & VM_NOHUGEPAGE)) goto out; /* * The destination pmd shouldn't be established, free_pgtables() * should have release it. */ - if (!pmd_none(*new_pmd)) { - WARN_ON(1); + if (!WARN_ON(pmd_none(*new_pmd))) { VM_BUG_ON(pmd_trans_huge(*new_pmd)); goto out; } @@ -1091,9 +1090,9 @@ int move_huge_pmd(struct vm_area_struct *vma, struct vm_area_struct *new_vma, spin_unlock(&mm->page_table_lock); ret = 1; } - } else + } else { spin_unlock(&mm->page_table_lock); - + } out: return ret; } diff --git a/mm/mremap.c b/mm/mremap.c index f0c4fcdbb4c6..d6959cb4df58 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -155,13 +155,13 @@ unsigned long move_page_tables(struct vm_area_struct *vma, if (err > 0) { need_flush = true; continue; - } else if (!err) + } else if (!err) { split_huge_page_pmd(vma->vm_mm, old_pmd); + } VM_BUG_ON(pmd_trans_huge(*old_pmd)); } if (pmd_none(*new_pmd) && __pte_alloc(new_vma->vm_mm, new_vma, - new_pmd, - new_addr)) + new_pmd, new_addr)) break; next = (new_addr + PMD_SIZE) & PMD_MASK; if (extent > next - new_addr)