lkml.org 
[lkml]   [2009]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] [9/21] HWPOISON: Handle hardware poisoned pages in try_to_unmap
    Date

    From: Andi Kleen <ak@linux.intel.com>

    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.

    v2: add a new flag to not do that (needed for the memory-failure handler
    later) (Fengguang)
    v3: remove unnecessary is_migration_entry() test (Fengguang, Minchan)

    Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
    Reviewed-by: Wu Fengguang <fengguang.wu@intel.com>
    Signed-off-by: Andi Kleen <ak@linux.intel.com>

    ---
    include/linux/rmap.h | 1 +
    mm/rmap.c | 9 ++++++++-
    2 files changed, 9 insertions(+), 1 deletion(-)

    Index: linux/mm/rmap.c
    ===================================================================
    --- linux.orig/mm/rmap.c
    +++ linux/mm/rmap.c
    @@ -820,7 +820,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
    + dec_mm_counter(mm, file_rss);
    + set_pte_at(mm, address, pte,
    + swp_entry_to_pte(make_hwpoison_entry(page)));
    + } else if (PageAnon(page)) {
    swp_entry_t entry = { .val = page_private(page) };

    if (PageSwapCache(page)) {
    Index: linux/include/linux/rmap.h
    ===================================================================
    --- linux.orig/include/linux/rmap.h
    +++ linux/include/linux/rmap.h
    @@ -93,6 +93,7 @@ enum ttu_flags {

    TTU_IGNORE_MLOCK = (1 << 8), /* ignore mlock */
    TTU_IGNORE_ACCESS = (1 << 9), /* don't age */
    + TTU_IGNORE_HWPOISON = (1 << 10),/* corrupted page is recoverable */
    };
    #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK)


    \
     
     \ /
      Last update: 2009-09-11 20:55    [W:0.020 / U:0.196 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site