Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2733351iob; Fri, 6 May 2022 09:14:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOd5T4o0/eJe4UcYYXik8zMP489XvFWK0jGUBlapkDCaWgVnoQJA19oBtzTxFoyGBk2+ch X-Received: by 2002:a62:be14:0:b0:505:a43b:cf6e with SMTP id l20-20020a62be14000000b00505a43bcf6emr4330740pff.33.1651853660510; Fri, 06 May 2022 09:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651853660; cv=none; d=google.com; s=arc-20160816; b=xVjVkQ9BXjSqoiuoSdWVxLheW7O50LIF8ZZgRPqLTkFZfZnzAgquiR7wV3c8m+wuU8 oKElTMd1Xr5L+WY5Jua9kHtKVn1mz5sVnF4xBSZMWZYtE6p0uaI+O8HrAwOjuQ+m1Opp FV5kEkd6ssR84i1ZBMITEdl81RiAzo4ne3/YvauC0LqibI6GSK1LRXO2Axz6v39vPKBd 4BYG516pYWs57m7y2exmUO/yzx4xZ0T6GSWsogEwvfjnU00twUDTd3ZlEHhDhwJ+dtJn s7NWvuy/5vXZId4FHfKbuSNujT2g6vLqLCfjRPzhzjQ2Ai17/hgQE8wUnuk72kf5sCZ0 ZIoA== 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=LAUW0vSgJcAftQD8gzfhfsgS87APTTZohbWrvT0aZGc=; b=iWaUSwDJq6zn1yeplPEd0q+jABPpc0n5qeLKlI/IbyoqJ+Y2sxopfYc/0nHN31+3Fj hQo8+X3KWHhDoWdhgkl79L/ueRWuisyd7AnL4BTe0K6nBJ/u25L3CoMbvdDFf+xdJQGO Q458t8lnXfkmASdH5kgkXulgJCBNggNSpkFIM7bY7J9gFWlgZusywT8xs5r1XXfjbO+U kRB94gfa5s+h2e8KR9aW87N0PeT5PosIE/KtOeLfGCd8ApOJmp9fukPdTLZuFYXwRZE+ 2v1s7yJYmklz4nkf/1u1/6T0Ndq2IXxf2Z5xWlDuzcO6oFz79KPV9vmGy9VPJ8wS6XIo Jq4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=vVcRx4Q1; 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 q7-20020a637507000000b003ab339bb2c2si5228803pgc.145.2022.05.06.09.14.05; Fri, 06 May 2022 09:14:20 -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=vVcRx4Q1; 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 S1390291AbiEFI71 (ORCPT + 99 others); Fri, 6 May 2022 04:59:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390284AbiEFI70 (ORCPT ); Fri, 6 May 2022 04:59:26 -0400 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 356B15DD01 for ; Fri, 6 May 2022 01:55:41 -0700 (PDT) Date: Fri, 6 May 2022 17:55:32 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1651827340; 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=LAUW0vSgJcAftQD8gzfhfsgS87APTTZohbWrvT0aZGc=; b=vVcRx4Q1/7tV3fymAg7pwv6CQFfOuPeqMnQmsIIHvuQDmG7uoL/PbuWU0rymoy71tXjBwF xasqAW8jXWf/GIaRFr6Bf9I5rTVe3knV+N9GpPxP6JeP9KmDz3nKxKBVBf8l2v6D5OoSvt H2z7/mRKiBC4umQOwN+sItNdk+/wNxM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Naoya Horiguchi To: zhenwei pi Cc: akpm@linux-foundation.org, naoya.horiguchi@nec.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wu Fengguang Subject: Re: [PATCH 1/4] mm/memory-failure.c: move clear_hwpoisoned_pages Message-ID: <20220506085532.GA1356094@u2004> References: <20220429142206.294714-1-pizhenwei@bytedance.com> <20220429142206.294714-2-pizhenwei@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220429142206.294714-2-pizhenwei@bytedance.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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 Fri, Apr 29, 2022 at 10:22:03PM +0800, zhenwei pi wrote: > clear_hwpoisoned_pages() clears HWPoison flag and decreases the number > of poisoned pages, this actually works as part of memory failure. > > Move this function from sparse.c to memory-failure.c, finally there > is no CONFIG_MEMORY_FAILURE in sparse.c. > > Cc: Wu Fengguang > Signed-off-by: zhenwei pi > --- > mm/internal.h | 11 +++++++++++ > mm/memory-failure.c | 21 +++++++++++++++++++++ > mm/sparse.c | 27 --------------------------- > 3 files changed, 32 insertions(+), 27 deletions(-) > > diff --git a/mm/internal.h b/mm/internal.h > index cf16280ce132..e8add8df4e0f 100644 > --- a/mm/internal.h > +++ b/mm/internal.h > @@ -758,4 +758,15 @@ struct folio *try_grab_folio(struct page *page, int refs, unsigned int flags); > > DECLARE_PER_CPU(struct per_cpu_nodestat, boot_nodestats); > > +/* > + * mm/memory-failure.c > + */ > +#ifdef CONFIG_MEMORY_FAILURE > +void clear_hwpoisoned_pages(struct page *memmap, int nr_pages); > +#else > +static inline void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) > +{ > +} > +#endif This code may be put near the definitions of hwpoison_filter* in mm/internal.h because they are also called from mm/memory-failure. Otherwise, looks good to me. Acked-by: Naoya Horiguchi