]> git.baikalelectronics.ru Git - kernel.git/commit
mm: teach mincore_hugetlb about pte markers
authorJames Houghton <jthoughton@google.com>
Thu, 2 Mar 2023 22:24:04 +0000 (22:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:34:03 +0000 (13:34 +0100)
commite9295ad15a9e3e9eb314f6c486a836ee3ee17cc5
treefd8f842d38245fd61793611e359176fe48cc6ffe
parentbe93f7f20c2bf7d0b27392f5f9970959bff0bbbd
mm: teach mincore_hugetlb about pte markers

commit c9d46e101a079d41582aaa8727b74a0f6e273a9b upstream.

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().

Link: https://lkml.kernel.org/r/20230302222404.175303-1-jthoughton@google.com
Fixes: f8a324dbfb0b ("mm: teach core mm about pte markers")
Signed-off-by: James Houghton <jthoughton@google.com>
Acked-by: Peter Xu <peterx@redhat.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: James Houghton <jthoughton@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/mincore.c