Skip to content

Commit c313dc5

Browse files
Weijie Yangtorvalds
authored andcommitted
mm: mincore: add hwpoison page handle
When the encountered pte is a swap entry, the current code handles two cases: migration and normal swapentry, but we have a third case: hwpoison page. This patch adds hwpoison page handle, consider hwpoison page incore as same as migration. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Weijie Yang <weijie.yang@samsung.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Mel Gorman <mgorman@suse.com> Cc: Hugh Dickins <hughd@google.com> Cc: Rik van Riel <riel@redhat.com> Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b258d86 commit c313dc5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎mm/mincore.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,11 @@ static void mincore_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
137137
} else { /* pte is a swap entry */
138138
swp_entry_t entry = pte_to_swp_entry(pte);
139139

140-
if (is_migration_entry(entry)) {
141-
/* migration entries are always uptodate */
140+
if (non_swap_entry(entry)) {
141+
/*
142+
* migration or hwpoison entries are always
143+
* uptodate
144+
*/
142145
*vec = 1;
143146
} else {
144147
#ifdef CONFIG_SWAP

0 commit comments

Comments
 (0)