diff options
author | Wei Yang <[email protected]> | 2020-08-06 23:23:40 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2020-08-07 11:33:27 -0700 |
commit | b8aa9d9d95b3b4b60d42ac95f65d33a92527aef3 (patch) | |
tree | bbe059eeca3a684c6b0f9e7d24a36726f30113c4 /arch/s390/mm/init.c | |
parent | 45e55300f11495ed58c53427da7f0d958800a30f (diff) |
mm/mremap: it is sure to have enough space when extent meets requirement
Patch series "mm/mremap: cleanup move_page_tables() a little", v5.
move_page_tables() tries to move page table by PMD or PTE.
The root reason is if it tries to move PMD, both old and new range should
be PMD aligned. But current code calculate old range and new range
separately. This leads to some redundant check and calculation.
This cleanup tries to consolidate the range check in one place to reduce
some extra range handling.
This patch (of 3):
old_end is passed to these two functions to check whether there is enough
space to do the move, while this check is done before invoking these
functions.
These two functions only would be invoked when extent meets the
requirement and there is one check before invoking these functions:
if (extent > old_end - old_addr)
extent = old_end - old_addr;
This implies (old_end - old_addr) won't fail the check in these two
functions.
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: Vlastimil Babka <[email protected]>
Cc: Yang Shi <[email protected]>
Cc: Thomas Hellstrom (VMware) <[email protected]>
Cc: Anshuman Khandual <[email protected]>
Cc: Sean Christopherson <[email protected]>
Cc: Wei Yang <[email protected]>
Cc: Peter Xu <[email protected]>
Cc: Aneesh Kumar K.V <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Thomas Hellstrom <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'arch/s390/mm/init.c')
0 files changed, 0 insertions, 0 deletions