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 DCF33C433FE for ; Thu, 27 Jan 2022 12:42:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 761ED6B0083; Thu, 27 Jan 2022 07:42:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7119A6B0085; Thu, 27 Jan 2022 07:42:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DA2E6B0087; Thu, 27 Jan 2022 07:42:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0105.hostedemail.com [216.40.44.105]) by kanga.kvack.org (Postfix) with ESMTP id 4E56C6B0083 for ; Thu, 27 Jan 2022 07:42:09 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 044B39369E for ; Thu, 27 Jan 2022 12:42:09 +0000 (UTC) X-FDA: 79076029578.18.68D729E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 7950CC0029 for ; Thu, 27 Jan 2022 12:42:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643287327; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+ZCYUwqDDdrT8j+JPGM77Yy7DvHBOZi+hMacOjThVUY=; b=hssR1OZpjc8SJIfcDb4IMSXoALBnz4g/TQi6cVdQzI3C7vl3GCc+bgA2fqinJaDltgwauJ Qa475wXZvxMLNESWZum7ZyGwWN64sJjGpMWoLynFEWvEZ2uwf27CZ6/PDRraoivfqmwkJE BggKqoD752n+ixHGCq07ZhY8ncn/QqQ= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-274-NPeQUSHfP62SYbtlrAUf-Q-1; Thu, 27 Jan 2022 07:42:05 -0500 X-MC-Unique: NPeQUSHfP62SYbtlrAUf-Q-1 Received: by mail-wm1-f70.google.com with SMTP id q125-20020a1c4383000000b003503e10c027so607698wma.2 for ; Thu, 27 Jan 2022 04:42:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=+ZCYUwqDDdrT8j+JPGM77Yy7DvHBOZi+hMacOjThVUY=; b=AeEJTb99Q/8IsSuC4ZZzvhvwMhfLf8Ho7sJRuxAa8S+C33vV0fHtTcaZk9sB21EMrJ bqegcX1MgOodPuGyC5x3XkztkIJYHcAoFDbq5LIwWyuME555HI1Pe3guW3FubFqaU6m4 1VtaDCcUhXSglpuNdRu+sY9F7DVqzpOUzg5+JCLxr9RcBBS7BXfx1PTuJUqQrfhboyW4 Zv1C6ECQU9WNHitXNcNxlmGPHGOKmETvkF/qRc6W39VR3lDHvEB3+2JcaCWcMqJmtkgh 5LtChrer4IiYBDqIJDJYgdMR5DpD/ThEw4TxuKhzFyqH0tt7LgHbrrpY9nSjVLpJe/65 xWuQ== X-Gm-Message-State: AOAM531Q+x/ZJ/XWrW27JoqaRllSRQxsDjSlzw/lhZk6QIeb41ayIG3U 9Ax6XD6sau+Zcl8fmRv2sePwcVsgAYn/lmBbJmbfWCvJbZAoJZFUdVsvmBYUGngDjMljSnwVrq7 rAVc/b3ZsKFw= X-Received: by 2002:a05:6000:2a2:: with SMTP id l2mr2917327wry.306.1643287324505; Thu, 27 Jan 2022 04:42:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJydYr4P2sdULpp26oBjp8Ca1fz+3CWDjiNf27VQMOA4/Yg68rBq308t6po6o05pm2mOjX23YQ== X-Received: by 2002:a05:6000:2a2:: with SMTP id l2mr2917301wry.306.1643287324225; Thu, 27 Jan 2022 04:42:04 -0800 (PST) Received: from ?IPV6:2003:cb:c70d:8300:4812:9d4f:6cd8:7f47? (p200300cbc70d830048129d4f6cd87f47.dip0.t-ipconnect.de. [2003:cb:c70d:8300:4812:9d4f:6cd8:7f47]) by smtp.gmail.com with ESMTPSA id 6sm2558520wry.69.2022.01.27.04.42.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jan 2022 04:42:03 -0800 (PST) Message-ID: <7b3eaee6-ae9b-5159-3cd8-5b38e7890229@redhat.com> Date: Thu, 27 Jan 2022 13:42:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH 3/6] mm, memory_hotplug: drop arch_free_nodedata To: Michal Hocko , Andrew Morton Cc: linux-mm@kvack.org, LKML , Alexey Makhalov , Dennis Zhou , Eric Dumazet , Oscar Salvador , Tejun Heo , Christoph Lameter , Nico Pache , Wei Yang , Rafael Aquini , Michal Hocko References: <20220127085305.20890-1-mhocko@kernel.org> <20220127085305.20890-4-mhocko@kernel.org> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220127085305.20890-4-mhocko@kernel.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 7950CC0029 X-Stat-Signature: dfr431ngrhq7o3ebbefh9wgnhehshxhn Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=hssR1OZp; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf28.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com X-Rspam-User: nil X-HE-Tag: 1643287328-956004 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 27.01.22 09:53, 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 > --- > 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); > -} As mentioned, maybe we want to rip out rollback_node_hotadd() in the previous patch. Acked-by: David Hildenbrand -- Thanks, David / dhildenb