* [PATCH] mm: mincore: add hwpoison page handle
@ 2014-11-12 3:39 Weijie Yang
2014-11-12 14:20 ` Johannes Weiner
0 siblings, 1 reply; 3+ messages in thread
From: Weijie Yang @ 2014-11-12 3:39 UTC (permalink / raw)
To: 'Johannes Weiner'
Cc: 'Andrew Morton', mgorman, 'Rik van Riel',
'Weijie Yang', 'Linux-MM', 'linux-kernel'
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.
Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
---
mm/mincore.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/mincore.c b/mm/mincore.c
index 725c809..3545f13 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -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
--
1.7.0.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: mincore: add hwpoison page handle
2014-11-12 3:39 [PATCH] mm: mincore: add hwpoison page handle Weijie Yang
@ 2014-11-12 14:20 ` Johannes Weiner
2014-11-14 1:02 ` Naoya Horiguchi
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Weiner @ 2014-11-12 14:20 UTC (permalink / raw)
To: Weijie Yang
Cc: 'Andrew Morton', mgorman, 'Rik van Riel',
'Weijie Yang', 'Linux-MM', 'linux-kernel'
On Wed, Nov 12, 2014 at 11:39:29AM +0800, Weijie Yang wrote:
> 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.
>
> Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
The change makes sense:
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
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 majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: mincore: add hwpoison page handle
2014-11-12 14:20 ` Johannes Weiner
@ 2014-11-14 1:02 ` Naoya Horiguchi
0 siblings, 0 replies; 3+ messages in thread
From: Naoya Horiguchi @ 2014-11-14 1:02 UTC (permalink / raw)
To: Johannes Weiner
Cc: Weijie Yang, 'Andrew Morton',
mgorman, 'Rik van Riel', 'Weijie Yang',
'Linux-MM', 'linux-kernel'
On Wed, Nov 12, 2014 at 09:20:22AM -0500, Johannes Weiner wrote:
> On Wed, Nov 12, 2014 at 11:39:29AM +0800, Weijie Yang wrote:
> > 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.
> >
> > Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
>
> The change makes sense:
>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
>
> 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 majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-14 1:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-12 3:39 [PATCH] mm: mincore: add hwpoison page handle Weijie Yang
2014-11-12 14:20 ` Johannes Weiner
2014-11-14 1:02 ` Naoya Horiguchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox