From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 557FEC433F5 for ; Thu, 27 Jan 2022 13:38:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDA156B0071; Thu, 27 Jan 2022 08:38:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D8A206B0072; Thu, 27 Jan 2022 08:38:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C50BF6B0073; Thu, 27 Jan 2022 08:38:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id B5DAD6B0071 for ; Thu, 27 Jan 2022 08:38:07 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 730EA8771D for ; Thu, 27 Jan 2022 13:38:07 +0000 (UTC) X-FDA: 79076170614.08.4FCEFA0 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf20.hostedemail.com (Postfix) with ESMTP id E59601C000C for ; Thu, 27 Jan 2022 13:38:06 +0000 (UTC) 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 ams.source.kernel.org (Postfix) with ESMTPS id EA11DB81EA5; Thu, 27 Jan 2022 13:38:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84951C340E4; Thu, 27 Jan 2022 13:38:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643290684; bh=Z4jXUhGXYRsf6W87aXU9TwJRX0rB6w8vez308ZXgmGk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cThq6PKD8052QciPNtsjzAI5JXCdzZ3Av3FiLuJIYnkhMe5xaJX9U9J0KMOHl8pNG TpMvGdEQNUl6ohX+qs1i/5nT1oRcohtBIajMqmsCmxe1LwcVY56ZEx3o2yEAQt6eKV YmUMg0mEkyekS5BDhrSu1vhNiTG1lZNnm1vVNcbfolMGPkf7B2sYZTE1iZa3a/G9Xp Nqw0SGXrNxuPTYcbFYGu3urfpPsORyCMYDVJ15nEPAJEwH9V0PWXAJBeEuIsH+gGY4 Na6pMH6tGoB4871lw7K4zBdhkxAT1kghmmjlyl0MfKt7kmOTOACElrzjo+MG9ITIK1 pP/S9gGyqswXA== Date: Thu, 27 Jan 2022 15:37:56 +0200 From: Mike Rapoport To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, LKML , David Hildenbrand , Alexey Makhalov , Dennis Zhou , Eric Dumazet , Oscar Salvador , Tejun Heo , Christoph Lameter , Nico Pache , Wei Yang , Rafael Aquini , Michal Hocko Subject: Re: [PATCH 3/6] mm, memory_hotplug: drop arch_free_nodedata Message-ID: References: <20220127085305.20890-1-mhocko@kernel.org> <20220127085305.20890-4-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220127085305.20890-4-mhocko@kernel.org> X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E59601C000C X-Rspam-User: nil Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cThq6PKD; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf20.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org X-Stat-Signature: nzzou1ouyrwmeticgpxpd5hhgbwd1ckx X-HE-Tag: 1643290686-153866 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jan 27, 2022 at 09:53:02AM +0100, Michal Hocko wrote: > From: Michal Hocko > > Prior to "mm: handle uninitialized numa nodes gracefully" memory hotplug > used to allocate pgdat when memory has been added to a node > (hotadd_init_pgdat) arch_free_nodedata has been only used in the > failure path because once the pgdat is exported (to be visible > by NODA_DATA(nid)) it cannot really be freed because there is no > synchronization available for that. > > pgdat is allocated for each possible nodes now so the memory hotplug > doesn't need to do the ever use arch_free_nodedata so drop it. > > This patch doesn't introduce any functional change. > > Acked-by: Rafael Aquini > Signed-off-by: Michal Hocko Acked-by: Mike Rapoport > --- > arch/ia64/mm/discontig.c | 5 ----- > include/linux/memory_hotplug.h | 3 --- > mm/memory_hotplug.c | 10 ---------- > 3 files changed, 18 deletions(-) > > diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c > index dd0cf4834eaa..73d0db36edb6 100644 > --- a/arch/ia64/mm/discontig.c > +++ b/arch/ia64/mm/discontig.c > @@ -615,11 +615,6 @@ pg_data_t * __init arch_alloc_nodedata(int nid) > return memblock_alloc(size, SMP_CACHE_BYTES); > } > > -void arch_free_nodedata(pg_data_t *pgdat) > -{ > - kfree(pgdat); > -} > - > void arch_refresh_nodedata(int update_node, pg_data_t *update_pgdat) > { > pgdat_list[update_node] = update_pgdat; > diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h > index cdd66bfdf855..60f09d3ebb3d 100644 > --- a/include/linux/memory_hotplug.h > +++ b/include/linux/memory_hotplug.h > @@ -24,17 +24,14 @@ struct vmem_altmap; > * node_data[nid] = kzalloc() works well. But it depends on the architecture. > * > * In general, generic_alloc_nodedata() is used. > - * Now, arch_free_nodedata() is just defined for error path of node_hot_add. > * > */ > extern pg_data_t *arch_alloc_nodedata(int nid); > -extern void arch_free_nodedata(pg_data_t *pgdat); > extern void arch_refresh_nodedata(int nid, pg_data_t *pgdat); > > #else /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ > > #define arch_alloc_nodedata(nid) generic_alloc_nodedata(nid) > -#define arch_free_nodedata(pgdat) generic_free_nodedata(pgdat) > > #ifdef CONFIG_NUMA > /* > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index fc991831d296..875cdc7ffa58 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -1217,16 +1217,6 @@ static pg_data_t __ref *hotadd_init_pgdat(int nid) > return pgdat; > } > > -static void rollback_node_hotadd(int nid) > -{ > - pg_data_t *pgdat = NODE_DATA(nid); > - > - arch_refresh_nodedata(nid, NULL); > - free_percpu(pgdat->per_cpu_nodestats); > - arch_free_nodedata(pgdat); > -} > - > - > /* > * __try_online_node - online a node if offlined > * @nid: the node ID > -- > 2.30.2 > -- Sincerely yours, Mike.