aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Yang <[email protected]>2020-08-06 23:23:48 -0700
committerLinus Torvalds <[email protected]>2020-08-07 11:33:27 -0700
commit349d9fbb0b0a6734bcac9c08c5cc21992da5d2e6 (patch)
tree98d42d6922cf9efaa7f5f2a4107e53b21f8e3d71
parent9ad9718bfa41f6ae62fb2a7244357e99ac00d25a (diff)
mm/mremap: start addresses are properly aligned
After previous cleanup, extent is the minimal step for both source and destination. This means when extent is HPAGE_PMD_SIZE or PMD_SIZE, old_addr and new_addr are properly aligned too. Since these two functions are only invoked in move_page_tables, it is safe to remove the check now. Signed-off-by: Wei Yang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Tested-by: Dmitry Osipenko <[email protected]> Acked-by: Kirill A. Shutemov <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Anshuman Khandual <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Peter Xu <[email protected]> Cc: Sean Christopherson <[email protected]> Cc: Thomas Hellstrom <[email protected]> Cc: Thomas Hellstrom (VMware) <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Yang Shi <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/huge_memory.c3
-rw-r--r--mm/mremap.c3
2 files changed, 0 insertions, 6 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 1e580fdad4d0..462a7dbd6350 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1729,9 +1729,6 @@ bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr,
struct mm_struct *mm = vma->vm_mm;
bool force_flush = false;
- if ((old_addr & ~HPAGE_PMD_MASK) || (new_addr & ~HPAGE_PMD_MASK))
- return false;
-
/*
* The destination pmd shouldn't be established, free_pgtables()
* should have release it.
diff --git a/mm/mremap.c b/mm/mremap.c
index c3622bfcf6d9..138abbae4f75 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -199,9 +199,6 @@ static bool move_normal_pmd(struct vm_area_struct *vma, unsigned long old_addr,
struct mm_struct *mm = vma->vm_mm;
pmd_t pmd;
- if ((old_addr & ~PMD_MASK) || (new_addr & ~PMD_MASK))
- return false;
-
/*
* The destination pmd shouldn't be established, free_pgtables()
* should have released it.