[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1378146870-g7zzncdn-mutt-n-horiguchi@ah.jp.nec.com>
Date: Mon, 02 Sep 2013 14:34:30 -0400
From: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To: Wanpeng Li <liwanp@...ux.vnet.ibm.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Andi Kleen <andi@...stfloor.org>,
Fengguang Wu <fengguang.wu@...el.com>,
Tony Luck <tony.luck@...el.com>, gong.chen@...ux.intel.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] mm/hwpoison: fix the lack of one reference count
against poisoned page
On Mon, Sep 02, 2013 at 08:33:44PM +0800, Wanpeng Li wrote:
> The lack of one reference count against poisoned page for hwpoison_inject w/o
> hwpoison_filter enabled result in hwpoison detect -1 users still referenced
> the page, however, the number should be 0 except the poison handler held one
> after successfully unmap. This patch fix it by hold one referenced count against
> poisoned page for hwpoison_inject w/ and w/o hwpoison_filter enabled.
>
> Before patch:
>
> [ 71.902112] Injecting memory failure at pfn 224706
> [ 71.902137] MCE 0x224706: dirty LRU page recovery: Failed
> [ 71.902138] MCE 0x224706: dirty LRU page still referenced by -1 users
>
> After patch:
>
> [ 94.710860] Injecting memory failure at pfn 215b68
> [ 94.710885] MCE 0x215b68: dirty LRU page recovery: Recovered
>
> Signed-off-by: Wanpeng Li <liwanp@...ux.vnet.ibm.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
> ---
> mm/hwpoison-inject.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c
> index afc2daa..4c84678 100644
> --- a/mm/hwpoison-inject.c
> +++ b/mm/hwpoison-inject.c
> @@ -20,8 +20,6 @@ static int hwpoison_inject(void *data, u64 val)
> if (!capable(CAP_SYS_ADMIN))
> return -EPERM;
>
> - if (!hwpoison_filter_enable)
> - goto inject;
> if (!pfn_valid(pfn))
> return -ENXIO;
>
> @@ -33,6 +31,9 @@ static int hwpoison_inject(void *data, u64 val)
> if (!get_page_unless_zero(hpage))
> return 0;
>
> + if (!hwpoison_filter_enable)
> + goto inject;
> +
> if (!PageLRU(p) && !PageHuge(p))
> shake_page(p, 0);
> /*
> --
> 1.8.1.2
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists