Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752609AbbGaINa (ORCPT ); Fri, 31 Jul 2015 04:13:30 -0400 Received: from TYO201.gate.nec.co.jp ([210.143.35.51]:36321 "EHLO tyo201.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751028AbbGaINZ convert rfc822-to-8bit (ORCPT ); Fri, 31 Jul 2015 04:13:25 -0400 From: Naoya Horiguchi To: Wang Xiaoqiang CC: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH] memory_failure: remove redundant check for the PG_HWPoison flag of 'hpage' Thread-Topic: [PATCH] memory_failure: remove redundant check for the PG_HWPoison flag of 'hpage' Thread-Index: AQHQydOI/d8Vnbby60+maleIYYAvm53xlDyAgAEm3QCAAeubAA== Date: Fri, 31 Jul 2015 08:12:19 +0000 Message-ID: <20150731081218.GA14902@hori1.linux.bs1.fc.nec.co.jp> References: <20150729155246.2fed1b96@hp> <20150729091725.GA1256@hori1.linux.bs1.fc.nec.co.jp> <20150730105246.6bcc0af5@hp> In-Reply-To: <20150730105246.6bcc0af5@hp> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.128.101.6] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: <168C1A5C72F36C4D9BD0E5B84802A310@gisp.nec.co.jp> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1312 Lines: 34 On Thu, Jul 30, 2015 at 10:52:46AM +0800, Wang Xiaoqiang wrote: ... > In your example, the 100th subage enter the memory > error handler firstly, and then it uses the > set_page_hwpoison_huge_page to set all subpages > with PG_HWPoison flag, the 50th page handler waits > for grab the lock_page(hpage) now. > > When the 100th page handler unlock the 'hpage', > the 50th grab it, and now the 'hapge' has been > set with PG_HWPosison. So PageHWPoison micro > will return true, and the following code will > be executed: > > if (PageHWPoison(hpage)) { > if ((hwpoison_filter(p) && TestClearPageHWPoison(p)) > || (p != hpage && TestSetPageHWPoison(hpage))) { > atomic_long_sub(nr_pages, &num_poisoned_pages); > unlock_page(hpage); > return 0; > } > } > > Now 'p' is 50th subpage, it doesn't equal the > 'hpage' obviously, so if we don't have TestSetPageHWPoison > here, it still will ignore the 50th error. Ah, you're right, thanks for the explanation, Xiaoqiang! Acked-by: Naoya Horiguchi -- 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/