Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752859AbbG2H6h (ORCPT ); Wed, 29 Jul 2015 03:58:37 -0400 Received: from mail.lzu.cn ([202.201.0.205]:46896 "EHLO lzu.edu.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752071AbbG2H6f (ORCPT ); Wed, 29 Jul 2015 03:58:35 -0400 X-Greylist: delayed 360 seconds by postgrey-1.27 at vger.kernel.org; Wed, 29 Jul 2015 03:58:35 EDT Date: Wed, 29 Jul 2015 15:52:46 +0800 From: Wang Xiaoqiang To: n-horiguchi@ah.jp.nec.com, n-horiguchi@ah.jp.nec.com, n-horiguchi@ah.jp.nec.com, n-horiguchi@ah.jp.nec.com, n-horiguchi@ah.jp.nec.com, n-horiguchi@ah.jp.nec.com, linux-kernel@vger.kernel.org Cc: n-horiguchi@ah.jp.nec.com, n-horiguchi@ah.jp.nec.com Subject: [PATCH] memory_failure: remove redundant check for the PG_HWPoison flag of 'hpage' Message-ID: <20150729155246.2fed1b96@hp> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CM-TRANSID: zQDJygA3Pd0+hrhVWsBTAA--.5554S2 X-Coremail-Antispam: 1UD129KBjvdXoWruFyDJF45GrWftw1Uur48Zwb_yoWDAFc_uw 4jywn3Can5tas2kr9rta97G34jqr48Wwn3X3WIy340yFyrJws7Jr4Fkr17X3s0qrWI9F17 ur18J3s3trW8CjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbkAYjsxI4VW3JwAYFVCjjxCrM7AC8VAFwI0_Gr0_Xr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4 A2jsIEc7CjxVAFwI0_GcCE3s1lnxkEFVAIw20F6cxK64vIFxWle2I262IYc4CY6c8Ij28I cVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx 0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwAC jcxG0xvY0x0EwIxGrVCF72vEw4AK0wCY02Avz4vE14v_GF4l42xK82IYc2Ij64vIr41l4I 8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xFxVAFwI0_Jrv_JF1l4IIF7cxFY4CI4VCY07Av 7xWlx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17 CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0 I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWrJr0_WFyUJwCI42 IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIev Ja73UjIFyTuYvjxUTF1vUUUUU X-CM-SenderInfo: pzdqw5btrqqzl2xovvfxof0/ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1274 Lines: 44 Hi, I find a little problem in the memory_failure function in mm/memory-failure.c . Please check it. memory_failure: remove redundant check for the PG_HWPoison flag of `hpage'. Since we have check the PG_HWPoison flag by `PageHWPoison' before, so the later check by `TestSetPageHWPoison' must return true, there is no need to check again! Signed-off-by: Wang Xiaoqiang --- 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 1cf7f29..7794fd8 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1115,7 +1115,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags) lock_page(hpage); if (PageHWPoison(hpage)) { if ((hwpoison_filter(p) && TestClearPageHWPoison(p)) - || (p != hpage && TestSetPageHWPoison(hpage))) { + || p != hpage) { atomic_long_sub(nr_pages, &num_poisoned_pages); unlock_page(hpage); return 0; -- 1.7.10.4 -- thx! Wang Xiaoqiang -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/