From: David Hildenbrand <david@redhat.com>
To: James Houghton <jthoughton@google.com>,
Peter Xu <peterx@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Axel Rasmussen <axelrasmussen@google.com>,
Anish Moorthy <amoorthy@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: teach mincore_hugetlb about pte markers
Date: Fri, 3 Mar 2023 10:10:37 +0100 [thread overview]
Message-ID: <69e08e1c-88f6-bf93-523a-b65ffb9235c5@redhat.com> (raw)
In-Reply-To: <20230302222404.175303-1-jthoughton@google.com>
On 02.03.23 23:24, James Houghton wrote:
> By checking huge_pte_none(), we incorrectly classify PTE markers as
> "present". Instead, check huge_pte_none_mostly(), classifying PTE
> markers the same as if the PTE were completely blank.
>
> PTE markers, unlike other kinds of swap entries, don't reference any
> physical page and don't indicate that a physical page was mapped
> previously. As such, treat them as non-present for the sake of
> mincore().
>
> Fixes: 5c041f5d1f23 ("mm: teach core mm about pte markers")
> Signed-off-by: James Houghton <jthoughton@google.com>
> ---
> mm/mincore.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/mincore.c b/mm/mincore.c
> index cd69b9db0081..d359650b0f75 100644
> --- a/mm/mincore.c
> +++ b/mm/mincore.c
> @@ -33,7 +33,7 @@ static int mincore_hugetlb(pte_t *pte, unsigned long hmask, unsigned long addr,
> * Hugepages under user process are always in RAM and never
> * swapped out, but theoretically it needs to be checked.
> */
> - present = pte && !huge_pte_none(huge_ptep_get(pte));
> + present = pte && !huge_pte_none_mostly(huge_ptep_get(pte));
> for (; addr != end; vec++, addr += PAGE_SIZE)
> *vec = present;
> walk->private = vec;
Acked-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
prev parent reply other threads:[~2023-03-03 9:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-02 22:24 James Houghton
2023-03-02 22:32 ` Peter Xu
2023-03-03 1:50 ` Andrew Morton
2023-03-03 9:10 ` David Hildenbrand [this message]
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=69e08e1c-88f6-bf93-523a-b65ffb9235c5@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=amoorthy@google.com \
--cc=axelrasmussen@google.com \
--cc=jthoughton@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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