From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758550Ab3IBMem (ORCPT ); Mon, 2 Sep 2013 08:34:42 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:50411 "EHLO e23smtp07.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758290Ab3IBMeG (ORCPT ); Mon, 2 Sep 2013 08:34:06 -0400 From: Wanpeng Li To: Andrew Morton Cc: Andi Kleen , Fengguang Wu , Naoya Horiguchi , Tony Luck , gong.chen@linux.intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH 2/4] mm/hwpoison: fix miss catch transparent huge page Date: Mon, 2 Sep 2013 20:33:42 +0800 Message-Id: <1378125224-12794-2-git-send-email-liwanp@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1378125224-12794-1-git-send-email-liwanp@linux.vnet.ibm.com> References: <1378125224-12794-1-git-send-email-liwanp@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13090212-0260-0000-0000-0000038EED7F Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 (PageTransHuge(page) && !PageHuge(page)) { pr_info("MCE: Memory failure is now running on %#lx\n", pfn); return 0; } -- 1.8.1.2