Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1595482pxa; Fri, 28 Aug 2020 18:14:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDdZ/zwJWs43ZFPfZsMpV49FRpT5GuXg29s8DJEDaYL49yd5eukskWuAYCZo9Q65Zf2W9n X-Received: by 2002:aa7:cd57:: with SMTP id v23mr1522608edw.342.1598663652164; Fri, 28 Aug 2020 18:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598663652; cv=none; d=google.com; s=arc-20160816; b=Wg8NU6RBC9Nxiz1cHzrMefVWEvOiVKo0Kf9NWCruLKkKaxK3j5ZArA7kO7BGqei8Rq InDW8nid/Sn7QGKXm5BLqqirKCOh+fFGckqfl60T56pWOKzQKuHzzsbuqHUCiZ7xepeN d0NK2fSO8FW6QLsnQPgbm31aGnT/iekAazovQ2FJf6HJzdsIJIg1C1xoRvhaXDqGnCZk pUAIjGtlw/rIFWSAkEMJfUsIktveky/rm7dg0qD5Pe1tN+lh7Wj5AViH2/OfLpe13MfT 6wfaJLaFwYqAV02PLjPQJQdpwRuOTbBhqBJr2fTA4M56yUYuU4DbmhE61f37MoCSCCCz mqBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=39XN9yo1hBG3Se1gfQYF3vziZZPdblGeQ4oQR1sH/O8=; b=StyJG9PwNiWrmDn+m37JxKv6RphLYfbpVNpCh41raJnEyl/VGuQkle5DC3uNLL0aGV P43dKkP+FzoNf2gB4E3IKFOs4IVfNGqby8nodzsQLhkzZ7c9PjCl0CPl+9OlUecdvo7N bAnXzcRdMYvnRvqu9nJxdN5l82cdaO3cazzUUVhwW5hxThwGXASoPUdDfLedi5VrdCiE nYlDbi9R7OSFPs+K897v1+tY3UtFOtJWprkXJKEjgQcS9DKxP/8OuMgiT9QnNOgUtwlK ABpGWnhO4PjLe90PgRY0XMjZjQ0kG/4C7JiIpnt+HvuQZcJWoOWWaYiti2wRqMXlQ8sy Wrww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=UgCNc6zV; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m17si528565eds.149.2020.08.28.18.13.48; Fri, 28 Aug 2020 18:14:12 -0700 (PDT) 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=@atishpatra.org header.s=google header.b=UgCNc6zV; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726820AbgH2BMQ (ORCPT + 99 others); Fri, 28 Aug 2020 21:12:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbgH2BMN (ORCPT ); Fri, 28 Aug 2020 21:12:13 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D247C06121B for ; Fri, 28 Aug 2020 18:12:12 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id w13so721245wrk.5 for ; Fri, 28 Aug 2020 18:12:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=39XN9yo1hBG3Se1gfQYF3vziZZPdblGeQ4oQR1sH/O8=; b=UgCNc6zV3jHlrg/Fv8Pd/IrqWUk206ZSYfkd1Atuw6CbnwlSWhIo20Ev2bp0NzbxNE 5+Oqahty8CR5kwHAXEbFaKD1X/femDV4haD3dBHW5mwpqzOGgAoCxqHujgVFfx1UHLfQ DbN1P+h/aae5Xy6kl9NPJkMdJU0rMyidTucdU= 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=39XN9yo1hBG3Se1gfQYF3vziZZPdblGeQ4oQR1sH/O8=; b=DSqxaO2O44AHDriQ3/u7DX1sCRqrdDW0URqZuWjlXiOvpCRrD3NHqcyXlXgv9vn0V8 OaQHivLKiaPGCQIoGQWLVYPi+Jjid3VMdD1VD8KViuXrlLCmUGK6OBaGmYAaHI2Udn38 qJmkJoexa/FDND8CB1A0M9VYPhsQNEENX4rYuJoc7VhLl+m9XrgelyRORZ9A7BH/SV57 1WhLa/KCNwUyKGXMyAMZFwaT3zt8fheNcM6jCq9NAOB/zkgfd3zlQge/oQlWncvSXToc O70/KWYuAQLLC5x/aUf0bPD2z6sYriG3EDButymiw40l752BuYymjRFumBYvAziGoo15 V7jA== X-Gm-Message-State: AOAM530Td5PGaB2aLdgqEWYkrnMMu56i75vjViDgPUiBX7CuhA/qtYnU Z4P4xqypDMmyRNf3U6knMk6plAaw2m2bb+8xwaiC X-Received: by 2002:adf:e411:: with SMTP id g17mr1444394wrm.77.1598663531166; Fri, 28 Aug 2020 18:12:11 -0700 (PDT) MIME-Version: 1.0 References: <20200828104830.000007bf@Huawei.com> <20200828161523.GA2158345@bjorn-Precision-5520> In-Reply-To: <20200828161523.GA2158345@bjorn-Precision-5520> From: Atish Patra Date: Fri, 28 Aug 2020 18:11:50 -0700 Message-ID: Subject: Re: [RFC/RFT PATCH 3/6] arm64, numa: Move pcibus_to_node definition to generic numa code To: Bjorn Helgaas Cc: Jonathan Cameron , "Rafael J. Wysocki" , Catalin Marinas , Atish Patra , Zong Li , linux-riscv , Will Deacon , linux-arch@vger.kernel.org, Rob Herring , Lorenzo Pieralisi , Ganapatrao Kulkarni , Steven Price , linux-pci@vger.kernel.org, Greentime Hu , Albert Ou , Arnd Bergmann , Anshuman Khandual , Paul Walmsley , Bjorn Helgaas , "linux-arm-kernel@lists.infradead.org" , Nick Hu , Greg Kroah-Hartman , Anup Patel , "linux-kernel@vger.kernel.org List" , Palmer Dabbelt , Andrew Morton , Mike Rapoport Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 28, 2020 at 9:15 AM Bjorn Helgaas wrote: > > On Fri, Aug 28, 2020 at 10:48:30AM +0100, Jonathan Cameron wrote: > > On Fri, 14 Aug 2020 14:47:22 -0700 > > Atish Patra wrote: > > > > > pcibus_to_node is used only when numa is enabled and does not depend > > > on ISA. Thus, it can be moved the generic numa implementation. > > > > > > Signed-off-by: Atish Patra > > > > From a more general unification point of view, there seem to > > be two ways architectures implement this. > > Either > > > > bus->sysdata.node > > > > Or as here. > > There are weird other options, but let us ignore those :) > > > > That is going to take a bit of unwinding should we > > want to take this unification further and perhaps we want to think > > about doing this in pci generic code rather than here? > > > > Perhaps this is one we are better keeping architecture specific for > > now? > > > > +CC Bjorn and Linux-pci > > > > > > > --- > > > arch/arm64/kernel/pci.c | 10 ---------- > > > drivers/base/arch_numa.c | 11 +++++++++++ > > > 2 files changed, 11 insertions(+), 10 deletions(-) > > > > > > diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c > > > index 1006ed2d7c60..07c122946c11 100644 > > > --- a/arch/arm64/kernel/pci.c > > > +++ b/arch/arm64/kernel/pci.c > > > @@ -54,16 +54,6 @@ int raw_pci_write(unsigned int domain, unsigned int bus, > > > return b->ops->write(b, devfn, reg, len, val); > > > } > > > > > > -#ifdef CONFIG_NUMA > > > - > > > -int pcibus_to_node(struct pci_bus *bus) > > > -{ > > > - return dev_to_node(&bus->dev); > > > -} > > > -EXPORT_SYMBOL(pcibus_to_node); > > > - > > > -#endif > > > - > > > #ifdef CONFIG_ACPI > > > > > > struct acpi_pci_generic_root_info { > > > diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c > > > index 83341c807240..4ab1b20a615d 100644 > > > --- a/drivers/base/arch_numa.c > > > +++ b/drivers/base/arch_numa.c > > > @@ -11,6 +11,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > > > > #ifdef CONFIG_ARM64 > > > @@ -60,6 +61,16 @@ EXPORT_SYMBOL(cpumask_of_node); > > > > > > #endif > > > > > > +#ifdef CONFIG_PCI > > > + > > > +int pcibus_to_node(struct pci_bus *bus) > > > +{ > > > + return dev_to_node(&bus->dev); > > > +} > > > +EXPORT_SYMBOL(pcibus_to_node); > > > + > > > +#endif > > I certainly agree that this should not be arch-specific, but I'm not > really in favor of adding this PCI gunk in drivers/base. > > I think we can do better (eventually) by getting rid of > pcibus_to_node() completely. It's not used very much except by > cpumask_of_pcibus(), which itself is hardly used at all. > I am a bit confused here. A quick grep suggested that pcibus_to_node() is also called from generic pci probe, controller and few drivers(block, infiniband) as well. Maybe I am missing something here ? We can move the pcibus_to_node to arch specific code for now if that's what is preferred. > > > static void numa_update_cpu(unsigned int cpu, bool remove) > > > { > > > int nid = cpu_to_node(cpu); > > > > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv -- Regards, Atish