Re: [PATCH 09/22] HWPOISON: Handle hardware poisoned pages in try_to_unmap

From: Minchan Kim
Date: Mon Jun 15 2009 - 09:09:21 EST


On Mon, Jun 15, 2009 at 11:45 AM, Wu Fengguang<fengguang.wu@xxxxxxxxx> wrote:
> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> When a page has the poison bit set replace the PTE with a poison entry.
> This causes the right error handling to be done later when a process runs
> into it.
>
> Also add a new flag to not do that (needed for the memory-failure handler
> later)
>
> Reviewed-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>
> Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> ---
> Âinclude/linux/rmap.h | Â Â1 +
> Âmm/rmap.c      Â|  Â9 ++++++++-
> Â2 files changed, 9 insertions(+), 1 deletion(-)
>
> --- sound-2.6.orig/mm/rmap.c
> +++ sound-2.6/mm/rmap.c
> @@ -958,7 +958,14 @@ static int try_to_unmap_one(struct page
> Â Â Â Â/* Update high watermark before we lower rss */
> Â Â Â Âupdate_hiwater_rss(mm);
>
> - Â Â Â if (PageAnon(page)) {
> + Â Â Â if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) {
> + Â Â Â Â Â Â Â if (PageAnon(page))
> + Â Â Â Â Â Â Â Â Â Â Â dec_mm_counter(mm, anon_rss);
> + Â Â Â Â Â Â Â else if (!is_migration_entry(pte_to_swp_entry(*pte)))

Isn't it straightforward to use !is_hwpoison_entry ?


--
Kinds regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/