[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 3 Mar 2023 10:10:37 +0100
From: David Hildenbrand <david@...hat.com>
To: James Houghton <jthoughton@...gle.com>,
Peter Xu <peterx@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Axel Rasmussen <axelrasmussen@...gle.com>,
Anish Moorthy <amoorthy@...gle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: teach mincore_hugetlb about pte markers
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@...gle.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@...hat.com>
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists