Skip to content

Commit 63cf584

Browse files
48caakpm00
authored andcommitted
mm: teach mincore_hugetlb about pte markers
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/[email protected] Fixes: 5c041f5 ("mm: teach core mm about pte markers") Signed-off-by: James Houghton <[email protected]> Acked-by: Peter Xu <[email protected]> Acked-by: David Hildenbrand <[email protected]> Cc: Axel Rasmussen <[email protected]> Cc: James Houghton <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent fe15c26 commit 63cf584

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/mincore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static int mincore_hugetlb(pte_t *pte, unsigned long hmask, unsigned long addr,
3333
* Hugepages under user process are always in RAM and never
3434
* swapped out, but theoretically it needs to be checked.
3535
*/
36-
present = pte && !huge_pte_none(huge_ptep_get(pte));
36+
present = pte && !huge_pte_none_mostly(huge_ptep_get(pte));
3737
for (; addr != end; vec++, addr += PAGE_SIZE)
3838
*vec = present;
3939
walk->private = vec;

0 commit comments

Comments
 (0)