mbox series

[RESEND,v2,0/4] mm/mremap: cleanup move_page_tables() a little

Message ID 20200626135216.24314-1-richard.weiyang@linux.alibaba.com (mailing list archive)
Headers show
Series mm/mremap: cleanup move_page_tables() a little | expand

Message

Wei Yang June 26, 2020, 1:52 p.m. UTC
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.

v2:
  * remove 3rd patch which doesn't work on ARM platform. Thanks report and
    test from Dmitry Osipenko

Wei Yang (4):
  mm/mremap: format the check in move_normal_pmd() same as
    move_huge_pmd()
  mm/mremap: it is sure to have enough space when extent meets
    requirement
  mm/mremap: calculate extent in one place
  mm/mremap: start addresses are properly aligned

 include/linux/huge_mm.h |  2 +-
 mm/huge_memory.c        |  8 +-------
 mm/mremap.c             | 17 ++++++-----------
 3 files changed, 8 insertions(+), 19 deletions(-)

Comments

Kirill A. Shutemov July 6, 2020, 10:08 a.m. UTC | #1
On Fri, Jun 26, 2020 at 09:52:12PM +0800, Wei Yang wrote:
> 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.

The patchet looks good to me. I have few nits, but nothing substantial.

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Wei Yang July 6, 2020, 10:06 p.m. UTC | #2
On Mon, Jul 06, 2020 at 01:08:19PM +0300, Kirill A. Shutemov wrote:
>On Fri, Jun 26, 2020 at 09:52:12PM +0800, Wei Yang wrote:
>> 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.
>
>The patchet looks good to me. I have few nits, but nothing substantial.
>
>Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>

Hi, Kirill

Thanks for your review.

Andrew,

Do you want me to send another version or you would like to adjust it
directly?

>-- 
> Kirill A. Shutemov
Andrew Morton July 6, 2020, 11:04 p.m. UTC | #3
On Mon, 6 Jul 2020 22:06:48 +0000 Wei Yang <richard.weiyang@gmail.com> wrote:

> >The patchet looks good to me. I have few nits, but nothing substantial.
> >
> >Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> >
> 
> Hi, Kirill
> 
> Thanks for your review.
> 
> Andrew,
> 
> Do you want me to send another version or you would like to adjust it
> directly?

Please resend?