From: Mike Kravetz <mike.kravetz@oracle.com>
To: Li Xinhai <lixinhai.lxh@gmail.com>, linux-mm@kvack.org
Cc: akpm@linux-foundation.org, Peter Xu <peterx@redhat.com>
Subject: Re: [PATCH V2] mm/hugetlb.c: fix unnecessary address expansion of pmd sharing
Date: Tue, 5 Jan 2021 10:23:59 -0800 [thread overview]
Message-ID: <b5adee5a-1fe0-7f78-02b0-936e8f21fa0d@oracle.com> (raw)
In-Reply-To: <20210104081631.2921415-1-lixinhai.lxh@gmail.com>
On 1/4/21 12:16 AM, Li Xinhai wrote:
> The current code would unnecessarily expand the address range. Consider
> one example, (start, end) = (1G-2M, 3G+2M), and (vm_start, vm_end) =
> (1G-4M, 3G+4M), the expected adjustment should be keep (1G-2M, 3G+2M)
> without expand. But the current result will be (1G-4M, 3G+4M). Actually,
> the range (1G-4M, 1G) and (3G, 3G+4M) would never been involved in pmd
> sharing.
>
> After this patch, we will check that the vma span at least one PUD
> aligned size and the start,end range overlap the aligned range of vma.
>
> With above example, the aligned vma range is (1G, 3G), so if (start, end)
> range is within (1G-4M, 1G), or within (3G, 3G+4M), then no adjustment
> to both start and end. Otherwise, we will have chance to adjust start
> downwards or end upwards without exceeding (vm_start, vm_end).
>
> Fixes: 75802ca66354 ("mm/hugetlb: fix calculation of adjust_range_if_pmd_sharing_possible")
> Suggested-by: Mike Kravetz <mike.kravetz@oracle.com>
> Cc: Mike Kravetz <mike.kravetz@oracle.com>
> Cc: Peter Xu <peterx@redhat.com>
> Signed-off-by: Li Xinhai <lixinhai.lxh@gmail.com>
> ---
Thanks again. Comments and discussion in previous thread.
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
--
Mike Kravetz
next prev parent reply other threads:[~2021-01-05 18:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 8:16 Li Xinhai
2021-01-05 18:23 ` Mike Kravetz [this message]
2021-01-06 0:49 ` Li Xinhai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b5adee5a-1fe0-7f78-02b0-936e8f21fa0d@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=lixinhai.lxh@gmail.com \
--cc=peterx@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox