Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp66281pxb; Thu, 27 Jan 2022 15:14:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCd2fpd/IEuPHy7a3sD20nBPusi394cfoCDuRc03M0kvKHiw1dheKq9brmeYhlc4pdnP3e X-Received: by 2002:a17:907:7faa:: with SMTP id qk42mr4602026ejc.29.1643325242397; Thu, 27 Jan 2022 15:14:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643325242; cv=none; d=google.com; s=arc-20160816; b=c4GVgHp7S1lE5/ktlNYebxU2tdrWHyz4hwoYOMb9L8Cs+WoIX05Rt4gRZdGoJQbboQ XutNM3jGUXC1jVo8HfruUH9NtgWXX7qPfraejHkV+l6vAsMLnCKtp8y8Uj435knk5d+T lD8fPhXxilvf8NtDH6/FLAUgaw5kCNkaGdN31d2TkMnpYUVHci3U8Bc6keeYJTLSSVbi OKUVgBMRulrB4fNqT4gEGBKTkgeeZcazi2Nq/uldyi5CSwwz3QHi/OPZECTSPDhIo+4l M1SBHIdcgA85BFx3fIhCgKRNCX/cmI0Q9X8s/kCBSkAb1vSRQ9lkqWKKC5diu2yczXSd dEow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=+ZCYUwqDDdrT8j+JPGM77Yy7DvHBOZi+hMacOjThVUY=; b=0POnsJ3RrWf+zxjryFXJm+ZBzUpmKmzLvTg/ydYdz4kBXuqdMxO4ZMW2RNjvA+9+b+ Nph2Jy1jMBgxyHfA9R5k+ok3qr6LIR60RMFzgOyajOzJA09JLHzgU2Bg5L65tF2JMuhX TvZK8da6mUxVE1WfLN8Y4HEaYslvkFjHA4JJJ4WPul12oG0xgnL7ZcQ3L+dD2C0Br51K Vq/xkff5vjI3aFRbQXekj4Is8j9Du0oPsioELOOMua85sxdYv0Rc4fM4opXlvIod0Eia H6z2ht3wAGXaxrLl6Xll54Qqb+bcI1abkJYCe/1qZk8TwpddCwfKvJ8o7ILlr1eJ2VQ3 OdjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hssR1OZp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si2169028ede.25.2022.01.27.15.13.37; Thu, 27 Jan 2022 15:14:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hssR1OZp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241313AbiA0MmO (ORCPT + 99 others); Thu, 27 Jan 2022 07:42:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47105 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241395AbiA0MmH (ORCPT ); Thu, 27 Jan 2022 07:42:07 -0500 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-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-542-1YOUl5ZSMVyL5oz83cHZuw-1; Thu, 27 Jan 2022 07:42:05 -0500 X-MC-Unique: 1YOUl5ZSMVyL5oz83cHZuw-1 Received: by mail-wm1-f71.google.com with SMTP id bg32-20020a05600c3ca000b00349f2aca1beso1421658wmb.9 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=si7odQBPnPhyxaRpdUhxMCESIqZuLvo9z/+hvy+cQRicM7vKZ/tRy883dwO1ENvE/I xsWWyR2wt8bui3eVTKgcbcPm7yTPm+o760tBzCagyY9YwjG9hgaNW6GqtZxqjzHh47qd EmjtJT4kU/llC8p4zSRbU3xRrb2h8NsQ/aj9Xllfm5v/opI/SGIvLfFh+pSytXjQdcGQ 0BBZfB6Qg8/ht7tGi/pV6TMamK4M26S2t+C/QA3iFvaFQ33k00bFdt6VfMdFhiIL92k5 rlMETMdc8U0lM6MgTxYCoaZFrRGYychrMRU58rVjtMB3a2A6AaBJsu5o9jI/2N2aJTv2 2Sig== X-Gm-Message-State: AOAM532ZuapiO9QXvQSpURkFTwO1xf6/8J4wnK46w1BNReOoUt1yevq7 alwXX95vK4TaWbDrZEJ3LtO/+/atvpIDUt94sCUzFseRw9g4wxgu7ttrxSRCKQP6GGxsXAFBSz1 EfhJlQg2RTMx7dd7SdstY7P5Y X-Received: by 2002:a05:6000:2a2:: with SMTP id l2mr2917325wry.306.1643287324505; Thu, 27 Jan 2022 04:42:04 -0800 (PST) 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 Content-Language: en-US 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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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