Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp174077pxb; Tue, 9 Mar 2021 20:07:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIKBDD+UeS9zXvfJA9C6iw1qQ+8CHJ2cEl6/XRchbaL9ecmQozJGM7JHI+2ncKQWWTBueD X-Received: by 2002:a17:907:7799:: with SMTP id ky25mr1395424ejc.217.1615349235092; Tue, 09 Mar 2021 20:07:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615349235; cv=none; d=google.com; s=arc-20160816; b=lWcygrXwHTp9tDe5dOdhu4pSJCf2QZnTy5wx3Z+cuwiRdnwkcJTLPONAucicg9Npll sJCdSc28Lfb06MY6kIULRlMiKAeXmQVS0VWJGq48YsTpUF8OIP4tHefU2dVDL9yG42Tg kfs4rwqlxozfUC3WBALp14XXFCPCp66+QkgN2AyWhM+auA6/28YnXy6X5lwxNXGkMyMh hggdEvKzMStTntqq8WMW1TVAlVJmt+OYlIla9gT3VwGM2HmRKWswpnyI/ZqW6KLRBeCq 11XVYxAshGBYYtnB8FDLjuy9EXz+Eui4W8sirhkuOirioGq1XAieWRC/uSMRRxpyWTWB j3nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WZ3rtEg/bwCYEb0dkhHomQWwGXuiWcjFrdtbUjGi/nM=; b=RtkinEYt0xPFr9sIeKBeL5f5rJkvDLm2XEEstPz5JX396z7PyeP1mdCc7QPUMBWy5F W1g3qk9bOI+QF2kM2JmmeinA/iq3mEFrjjW5sVhwHn+u5UhPB+T4G+HznER46nwW4fSu SxoO4MLmm5wVLKvobZNmHvhVqMFv3dhYNIlba4erugDxNpvY7y/SzwCNBHHqFjjN7LFs RP9xIl8NC0AfQ3I+5OBS7KViYPtA0IAT7Q4R954Ni+tjrzZ5Q0eSQlDi4yN/urUF0wV0 OR9e38kLMGRf4syZMe81RMmtuVxHcVY1ESv3L2CICOtqIevddUiH11KPUa0RDXrP8qEK Wwlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BlYVfepG; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si3547840ejf.52.2021.03.09.20.06.53; Tue, 09 Mar 2021 20:07:15 -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=@gmail.com header.s=20161025 header.b=BlYVfepG; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230047AbhCJEF7 (ORCPT + 99 others); Tue, 9 Mar 2021 23:05:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232359AbhCJEFr (ORCPT ); Tue, 9 Mar 2021 23:05:47 -0500 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0C63C06174A for ; Tue, 9 Mar 2021 20:05:46 -0800 (PST) Received: by mail-io1-xd2e.google.com with SMTP id a7so16415446iok.12 for ; Tue, 09 Mar 2021 20:05:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WZ3rtEg/bwCYEb0dkhHomQWwGXuiWcjFrdtbUjGi/nM=; b=BlYVfepGwUqTOaZpCTkLZ8ye5WNMoLIiihM0O1hVkvmmwE/11uJH2jDcpeQwCFZr6q 08b1COfPAU8yCULs66j4vvI+zgoEMoV9VLnUJ88Tm73TIhc2Ira5K8dEc71u3yegDD+9 l22jzt1kD8syXAmWFS9rdnoLCGv5HIoIlGdArTBeF/KVozfH8pGJ1P37c5rjh1eKAUo5 TDzhb/hPs0LkMc9efVlJs77fth97iWqeHGiveazyswfo1K3DQ/skbtFxd3JxG9cIpMLl pz7J9fZgUF8kY+9dip7p/CxZpfL1iE5hjuhxfK5DtrWz6KDcyodkjdS7MQDhDktzmQTd Nj4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WZ3rtEg/bwCYEb0dkhHomQWwGXuiWcjFrdtbUjGi/nM=; b=P5L6QJ7ok6TQSyD59I7shp5/QYsDNAEP+Ap5xg/fMLKR46OmICv6Tfkn9dpmLlYkB8 LWtEzH2SUzJ11W+NIYUb3xYMlycDbwS+XtpvHdEBKE2GsyMSfHwa7HUFqweGzWmL5aEc oP6efmyPnXuZCAcujOWbFBGfxTSdzfFtvDzIxt0V5ayuE/CdlVP3toQBv9wWdIvaAEv1 sjHQgWqHmfhNyR1Im1V4DCfy0yig4t7lrliJaVEeGo6ua7xrFzYmYZzIclau0Ull/lhK Bdy2pOArPccbrl5sf0lZKR9kRalDoJV5p2RdvLG61WBLWuVK1QhAHgfCXS/iLTRUfTSk 1sjg== X-Gm-Message-State: AOAM5323+UDzS1INinOr1Lt3ECaN3fwzUNy8Htl29zTGYLbkGUoiJayw fA11RYHUOh92guP6F5yq1AxFOPjxwIZnTwSl5A== X-Received: by 2002:a05:6602:2018:: with SMTP id y24mr1160030iod.74.1615349146331; Tue, 09 Mar 2021 20:05:46 -0800 (PST) MIME-Version: 1.0 References: <20210309102138.41170-1-kernelfans@gmail.com> <20210309140159.GA28395@willie-the-truck> In-Reply-To: <20210309140159.GA28395@willie-the-truck> From: Pingfan Liu Date: Wed, 10 Mar 2021 12:05:35 +0800 Message-ID: Subject: Re: [PATCH] drivers/arch_numa: remove rebudant setup_per_cpu_areas() To: Will Deacon Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Greg Kroah-Hartman , "Rafael J. Wysocki" , Atish Patra , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 9, 2021 at 10:02 PM Will Deacon wrote: > > [typo in subject "rebudant"] > > On Tue, Mar 09, 2021 at 06:21:38PM +0800, Pingfan Liu wrote: > > There are two identical implementations of setup_per_cpu_areas() in > > mm/percpu.c and drivers/base/arch_numa.c. > > > > Hence removing the one in arch_numa.c. And let arm64 drop > > HAVE_SETUP_PER_CPU_AREA. > > > > Signed-off-by: Pingfan Liu > > Cc: Catalin Marinas > > Cc: Will Deacon > > Cc: Greg Kroah-Hartman > > Cc: "Rafael J. Wysocki" > > Cc: Atish Patra > > Cc: linux-kernel@vger.kernel.org > > To: linux-arm-kernel@lists.infradead.org > > --- > > arch/arm64/Kconfig | 4 ---- > > drivers/base/arch_numa.c | 22 ---------------------- > > 2 files changed, 26 deletions(-) > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > index 1f212b47a48a..d4bf8be0c3d5 100644 > > --- a/arch/arm64/Kconfig > > +++ b/arch/arm64/Kconfig > > @@ -1022,10 +1022,6 @@ config USE_PERCPU_NUMA_NODE_ID > > def_bool y > > depends on NUMA > > > > -config HAVE_SETUP_PER_CPU_AREA > > - def_bool y > > - depends on NUMA > > - > > config NEED_PER_CPU_EMBED_FIRST_CHUNK > > def_bool y > > depends on NUMA > > diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c > > index 4cc4e117727d..23e1e419a83d 100644 > > --- a/drivers/base/arch_numa.c > > +++ b/drivers/base/arch_numa.c > > @@ -167,28 +167,6 @@ static void __init pcpu_fc_free(void *ptr, size_t size) > > { > > memblock_free_early(__pa(ptr), size); > > } > > - > > -void __init setup_per_cpu_areas(void) > > -{ > > - unsigned long delta; > > - unsigned int cpu; > > - int rc; > > - > > - /* > > - * Always reserve area for module percpu variables. That's > > - * what the legacy allocator did. > > - */ > > - rc = pcpu_embed_first_chunk(PERCPU_MODULE_RESERVE, > > - PERCPU_DYNAMIC_RESERVE, PAGE_SIZE, > > - pcpu_cpu_distance, > > - pcpu_fc_alloc, pcpu_fc_free); > > This doesn't look identical to the version in mm/percpu.c -- that one passes > NULL instead of 'pcpu_cpu_distance' and tries to allocate the pcpu memory on > the relevant NUMA nodes. In fact, if you could remove this function, you > could probably remove the whole HAVE_SETUP_PER_CPU_AREA block here as the > other functions are just used as helpers. So I'm not sure this is valid. > You are right. I need to rethink about it to see whether these two functions can be unified into one. Thanks, Pingfan