From 02801377db1f9a30b7c2e1c3819843b222886858 Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Wed, 5 Oct 2011 11:43:02 +1100 Subject: [PATCH] thp-mremap-support-and-tlb-optimization-fix-fix-fix Signed-off-by: Andrew Morton --- mm/huge_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index fffab174f3e7..6b072bdccf81 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1064,7 +1064,7 @@ 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 || + old_end - old_addr < HPAGE_PMD_SIZE || (new_vma->vm_flags & VM_NOHUGEPAGE)) goto out; -- 2.39.5