Skip to contentSkip to conversation

mm: mincore: add hwpoison page handle

PATCH In review Weijie Yang 3 participants 3 messages Nov 12, 2014 – Nov 14, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: mincore: add hwpoison page handle

When encounter 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.

---
 mm/mincore.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
mm/mincore.c +2 -2
index 725c809..3545f13 100644
@@ -137,8 +137,8 @@ static void mincore_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
 		} else { /* pte is a swap entry */
 			swp_entry_t entry = pte_to_swp_entry(pte);
 
-			if (is_migration_entry(entry)) {
-				/* migration entries are always uptodate */
+			if (non_swap_entry(entry)) {
+			/* migration or hwpoison entries are always uptodate */
 				*vec = 1;
 			} else {
 #ifdef CONFIG_SWAP
Signature · 8 lines
1.7.0.4


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Weijie Yang

When encounter 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.

The change makes sense:

But please add a description of what happens when a poison entry is encountered with the current code. I'm guessing swap_address_space() will return garbage and this might crash the kernel?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
Quoted 8 lines · Johannes Weiner
Quoted 7 lines · Weijie Yang

When encounter 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.

Quoted 8 lines

The change makes sense:

But please add a description of what happens when a poison entry is encountered with the current code. I'm guessing swap_address_space() will return garbage and this might crash the kernel?

Yes, I think that's correct.

Thanks,
Naoya Horiguchi
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>