Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10272737rwp; Thu, 20 Jul 2023 18:10:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlFpvUuWZH+zrchyH0xgAfJ+qYqJzMvFkNkP6INPY2NYAyUzsgItHtIYLNJIh4Cre8sKhnFZ X-Received: by 2002:a9d:7a86:0:b0:6b8:7fe2:cdde with SMTP id l6-20020a9d7a86000000b006b87fe2cddemr537768otn.29.1689901807406; Thu, 20 Jul 2023 18:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689901807; cv=none; d=google.com; s=arc-20160816; b=xpOZRDI61UpWikLOZzuHtrsTjsz+HA+MWfud4Z0rbziMHNDztsP/WybdPQ7If+13zW 1grYZAq91/CUjuNa1Wz0NNaGKAUvBGYyy/5HJh53HTOhVrX+XHQHthOH/SFr6qccCNt4 QKTkuf3PMqiS6+D+wzeJBWiEppFh+/bhbv4kAAJ+PVb7RLmXBkzjOEJlNQx4Bx2IbFV7 IM2cJ3ELUkxeRNkxtLw1FwUjJL5fJVpT8fZtVdhVrbwb+rCrkbEXW4KXr8x1W+4Lyttn 1/CA56dg3rmwvF2j8RVleM9S9B+gfGyrWR5p6ML64IxDsNxeh2Cu734FScdUDRDlftku O5rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=qbChIIegeF8b7DBlkfq1kqpyVn4AFCoYXtz9ldaoy2E=; fh=IGo2v47R2MqZMk4oSX6y1kJZIAXF8hsWb9KteX0pOuE=; b=E8bujjYq5RApp0Lb7i/s5BxdtXwEE3Y/PFGb8JbET7QK709lNguerHBz55m+QBiGie 39P+mDD7sJIOQYgsYrD2BEv0g+Y81phE46dRmUTj9I6GF6eIKX8OC8YpnhqgQOICm8VP tOeATuSJlUWuGv9W3vHEgWHBD5RlItyR5nUDsL1BI0zBbZpi6rYqEPaTYWzsv+DDVT9l kL9uQwTjE7Na3YGm0+TbpfbOeAe/R6P3ywovy8FQ0pugUSiPfNEG3yOuXBxFtTsS1c1o OxHzHF3pjnFnDaH9sVNuaDLi4s86CpX4q3zaw3bssoirZ+7N3lKUKsXr5jGDuLf7JkM/ gQtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ClcEmJFv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j72-20020a638b4b000000b0056382603322si599596pge.572.2023.07.20.18.09.55; Thu, 20 Jul 2023 18:10:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ClcEmJFv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229571AbjGTXzU (ORCPT + 99 others); Thu, 20 Jul 2023 19:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGTXzT (ORCPT ); Thu, 20 Jul 2023 19:55:19 -0400 Received: from out-59.mta0.migadu.com (out-59.mta0.migadu.com [IPv6:2001:41d0:1004:224b::3b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DB9A1BD for ; Thu, 20 Jul 2023 16:55:18 -0700 (PDT) Date: Fri, 21 Jul 2023 08:55:07 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1689897314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qbChIIegeF8b7DBlkfq1kqpyVn4AFCoYXtz9ldaoy2E=; b=ClcEmJFv+fA6sN063MX5EOZtHotpyMqcnkzqcAMohi+ZzAPQE62F+/bzrPAJCmZU7IeZLy WSMSCuvrbdxh2gzY4uQwYfrUpz3qtciOZcG2iyfC0f2fnJ/AUwzu8fU/A5QDK2h1PgcwiP 66i1pM+Vc6CDcxmcDpRRnaA6dlxyo/I= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Naoya Horiguchi To: Miaohe Lin Cc: akpm@linux-foundation.org, naoya.horiguchi@nec.com, shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/4] mm: memory-failure: add PageOffline() check Message-ID: <20230720235507.GA2069669@ik1-406-35019.vs.sakura.ne.jp> References: <20230715031729.2420338-1-linmiaohe@huawei.com> <20230715031729.2420338-5-linmiaohe@huawei.com> <20230720010953.GC1583723@ik1-406-35019.vs.sakura.ne.jp> <0161d32a-79d8-912c-0981-496a15f3eebf@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0161d32a-79d8-912c-0981-496a15f3eebf@huawei.com> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 20, 2023 at 04:42:04PM +0800, Miaohe Lin wrote: > On 2023/7/20 9:09, Naoya Horiguchi wrote: > > On Sat, Jul 15, 2023 at 11:17:29AM +0800, Miaohe Lin wrote: > >> Memory failure is not interested in logically offlined page. Skip this > >> type of pages. > >> > >> Signed-off-by: Miaohe Lin > >> --- > >> mm/memory-failure.c | 5 +++-- > >> 1 file changed, 3 insertions(+), 2 deletions(-) > >> > >> diff --git a/mm/memory-failure.c b/mm/memory-failure.c > >> index 42e63b0ab5f7..ed79b69837de 100644 > >> --- a/mm/memory-failure.c > >> +++ b/mm/memory-failure.c > >> @@ -1559,7 +1559,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn, > >> * Here we are interested only in user-mapped pages, so skip any > >> * other types of pages. > >> */ > >> - if (PageReserved(p) || PageSlab(p) || PageTable(p)) > >> + if (PageReserved(p) || PageSlab(p) || PageTable(p) || PageOffline(p)) > > > > hwpoison_user_mappings() is called after some checks are done, so I'm not > > sure that it's the right place to check PageOffline(). > > hwpoison_user_mappings() is called after the "if (!PageLRU(p) && !PageWriteback(p))" check in memory_failure(). > So the page can't also be PageReserved(p) or PageSlab(p) or PageTable(p) here? I think the check here just wants > to make things clear that only user-mapped pages are interested. Or am I miss something? No, you're right, So this "if (PageReserved(p) || PageSlab(p) || PageTable(p) || PageOffline(p))" can be considered as checking potential deviation. OK, so the patch is fine. Acked-by: Naoya Horiguchi