Re: [PATCH v2 2/4] mm/hwpoison: fix miss catch transparent huge page

From: Chen Gong
Date: Mon Sep 02 2013 - 23:27:57 EST


On Tue, Sep 03, 2013 at 07:36:44AM +0800, Wanpeng Li wrote:
> Date: Tue, 3 Sep 2013 07:36:44 +0800
> From: Wanpeng Li <liwanp@xxxxxxxxxxxxxxxxxx>
> To: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>, Fengguang Wu
> <fengguang.wu@xxxxxxxxx>, Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx>,
> Tony Luck <tony.luck@xxxxxxxxx>, gong.chen@xxxxxxxxxxxxxxx,
> linux-mm@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Wanpeng Li
> <liwanp@xxxxxxxxxxxxxxxxxx>
> Subject: [PATCH v2 2/4] mm/hwpoison: fix miss catch transparent huge page
> X-Mailer: git-send-email 1.7.5.4
>
> Changelog:
> *v1 -> v2: reverse PageTransHuge(page) && !PageHuge(page) check
>
> PageTransHuge() can't guarantee the page is transparent huge page since it
> return true for both transparent huge and hugetlbfs pages. This patch fix
> it by check the page is also !hugetlbfs page.
>
> Before patch:
>
> [ 121.571128] Injecting memory failure at pfn 23a200
> [ 121.571141] MCE 0x23a200: huge page recovery: Delayed
> [ 140.355100] MCE: Memory failure is now running on 0x23a200
>
> After patch:
>
> [ 94.290793] Injecting memory failure at pfn 23a000
> [ 94.290800] MCE 0x23a000: huge page recovery: Delayed
> [ 105.722303] MCE: Software-unpoisoned page 0x23a000
>
> Signed-off-by: Wanpeng Li <liwanp@xxxxxxxxxxxxxxxxxx>
> ---
> mm/memory-failure.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index e28ee77..b114570 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1349,7 +1349,7 @@ int unpoison_memory(unsigned long pfn)
> * worked by memory_failure() and the page lock is not held yet.
> * In such case, we yield to memory_failure() and make unpoison fail.
> */
> - if (PageTransHuge(page)) {
> + if (!PageHuge(page) && PageTransHuge(page)) {
> pr_info("MCE: Memory failure is now running on %#lx\n", pfn);
> return 0;
> }

Not sure which git tree should be used to apply this patch series? I assume
this patch series follows this link: https://lkml.org/lkml/2013/8/26/76.

In unpoison_memory we already have
if (PageHuge(page)) {
...
return 0;
}
so it looks like this patch is redundant.

Attachment: signature.asc
Description: Digital signature