From 8bef630abc4153eb04f609d7fbcfceb88239b489 Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Wed, 28 Sep 2011 10:50:15 +1000 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