Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp610912rwd; Wed, 7 Jun 2023 04:48:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4zvIVzmTzPW7vJrqoTBZQW4pjZewVZWtBX7IgBAKL4axN/XlIMvBDGyycKFRiKxJoIb9ab X-Received: by 2002:a05:6a00:1a05:b0:659:4b77:51e8 with SMTP id g5-20020a056a001a0500b006594b7751e8mr6568574pfv.15.1686138514135; Wed, 07 Jun 2023 04:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686138514; cv=none; d=google.com; s=arc-20160816; b=oYVf7xxIIX4rUHTtCF8617xJxgaZzOODVNNDVrDvWkaOuxwz1IHacKyBI7yzRYmdra fZQZ/zTdkg3xHGJstwAOuJP8kMYVvy72qJryhJArwqdl1PvtvI6iCkH0BU8foy1HEMOp mnHFT3BK6NngVZemC1gjWcfAidgeud7d/88v2zEkYgsYWjjiTchUCfHz2p9D+8CP/sm5 oBH4WX8zTTXw9SNMWLFBhlAMQRbwUmtSWw2VfTNBclPI/9SMKgSvIjNhjkkwuWMfKFxx 0uMWifT2atgUa9+RQZ2p8GFXE0YfFHIcAsHIHOTh9lF2KfohEN/UH12/EYQNf26xr/pc fSFg== 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:date:dkim-signature; bh=Edd6CqeT1Jv8wOOCIgEQtEBna+OKqySUj8TaKTFv8eQ=; b=leBpG9k0t/mzYiFRyn+5w26z5YH2WwxdStUrjKqzBAaRZjRtAIcqICJYgBIaOt8Vkd aDdA+0bssmSGXC6wBF3mo02Ela719XXkSA02i8WdgDEmIw4FfEhsAk+Qb+8yEwNV17UX 86IYcd80KwBIKV+ApiXliABQgw+8/g7iby/50YXNcl+TKDPO2bmyYP68nKdB1CDT7xkp lDcdrg/Py+7CSUsXaHllc/Zd2+zdWDdf1wd8Y9jH/LSNIvbrsdjf93/yjhTlBDSMwfYG Wjynr4xu6VcFgeJEyINy56qupAH/j2AxF3nfH4Iao0VMfhYTDsd93c/Y5UDD7QSeJx3+ 2LbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l9jqMmOf; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i188-20020a6254c5000000b00646479e5702si8623793pfb.381.2023.06.07.04.48.19; Wed, 07 Jun 2023 04:48:34 -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=@kernel.org header.s=k20201202 header.b=l9jqMmOf; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239281AbjFGLX3 (ORCPT + 99 others); Wed, 7 Jun 2023 07:23:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240066AbjFGLX0 (ORCPT ); Wed, 7 Jun 2023 07:23:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19C8A1720 for ; Wed, 7 Jun 2023 04:23:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A201B63394 for ; Wed, 7 Jun 2023 11:23:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66A54C433EF; Wed, 7 Jun 2023 11:23:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686137005; bh=692XokvxKzDQrzsRY0aIK8Ow6Q63x8VkG9gKJSs7Pqc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l9jqMmOfxNpxEBRsiMWKN3ziafDCD5xZkky5cqz2nXO3S7wnqKxVyyWuJA7hIer7U COvHylReJPdxeFRNY+cmqpKZDl4N7F8jdVbnepnmtZi3eXUnJ4tH5zvBjPsb3vgtSr JaZm2x/A6ACFuWHgYGRjqUHgM2ESd3APsRK9mZh5nPBVYRT4VD1X/HnhA0WdFIjGAn Hgj7o6eWMn1y3J078IvIXo3cxFUAyhJG372oicTmwA1b9tM/oI1U0M+ZjFYCLPhzlC wKsVkXXA8L5zefMFTV4ZceZbVwiQVf0ZWN8pdGmcZoYuBOjgO8RT5Luf4qtOyhmO89 MWOrQBAOssFpw== Date: Wed, 7 Jun 2023 14:23:00 +0300 From: Mike Rapoport To: Haifeng Xu Cc: david@redhat.com, mhocko@kernel.org, osalvador@suse.de, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] mm/memory_hotplug: remove reset_node_managed_pages() in hotadd_init_pgdat() Message-ID: <20230607112300.GF52412@kernel.org> References: <20230607024548.1240-1-haifeng.xu@shopee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230607024548.1240-1-haifeng.xu@shopee.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Wed, Jun 07, 2023 at 02:45:48AM +0000, Haifeng Xu wrote: > managed pages has already been set to 0 in free_area_init_core_hotplug(), > via zone_init_internals() on each zone. It's pointless to reset again. > > Furthermore, reset_node_managed_pages() no longer needs to be exposed > outside of mm/memblock.c. Remove declaration in include/linux/memblock.h > and define it as static. > > In addtion to this, the only caller of reset_node_managed_pages() is > reset_all_zones_managed_pages(), which is annotated with __init, so it > should be safe to also mark reset_node_managed_pages() as __init. > > Signed-off-by: Haifeng Xu > Suggested-by: David Hildenbrand Acked-by: Mike Rapoport (IBM) > --- > v2: > - unexport reset_node_managed_pages() > - mark reset_node_managed_pages() as __init > - update commit message > --- > include/linux/memblock.h | 1 - > mm/memblock.c | 2 +- > mm/memory_hotplug.c | 1 - > 3 files changed, 1 insertion(+), 3 deletions(-) > > diff --git a/include/linux/memblock.h b/include/linux/memblock.h > index f82ee3fac1cd..f71ff9f0ec81 100644 > --- a/include/linux/memblock.h > +++ b/include/linux/memblock.h > @@ -128,7 +128,6 @@ int memblock_clear_nomap(phys_addr_t base, phys_addr_t size); > > void memblock_free_all(void); > void memblock_free(void *ptr, size_t size); > -void reset_node_managed_pages(pg_data_t *pgdat); > void reset_all_zones_managed_pages(void); > > /* Low level functions */ > diff --git a/mm/memblock.c b/mm/memblock.c > index 3feafea06ab2..da4264528e1e 100644 > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -2122,7 +2122,7 @@ static unsigned long __init free_low_memory_core_early(void) > > static int reset_managed_pages_done __initdata; > > -void reset_node_managed_pages(pg_data_t *pgdat) > +static void __init reset_node_managed_pages(pg_data_t *pgdat) > { > struct zone *z; > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index 8e0fa209d533..65e385f34679 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -1210,7 +1210,6 @@ static pg_data_t __ref *hotadd_init_pgdat(int nid) > * online_pages() and offline_pages(). > * TODO: should be in free_area_init_core_hotplug? > */ > - reset_node_managed_pages(pgdat); > reset_node_present_pages(pgdat); > > return pgdat; > -- > 2.25.1 > -- Sincerely yours, Mike.