This series attempts to move the ARM64 numa implementation to common
code so that RISC-V can leverage that as well instead of reimplementing
it again.
RISC-V specific bits are based on initial work done by Greentime Hu [1] but
modified to reuse the common implementation to avoid duplication.
[1] https://lkml.org/lkml/2020/1/10/233
This series has been tested on qemu with numa enabled for both RISC-V & ARM64.
It would be great if somebody can test it on numa capable ARM64 hardware platforms.
This patch series doesn't modify the maintainers list for the common code (arch_numa)
as I am not sure if somebody from ARM64 community or Greg should take up the
maintainership. Ganapatrao was the original author of the arm64 version.
I would be happy to update that in the next revision once it is decided.
# numactl --hardware
available: 2 nodes (0-1)
node 0 cpus: 0 1 2 3
node 0 size: 486 MB
node 0 free: 470 MB
node 1 cpus: 4 5 6 7
node 1 size: 424 MB
node 1 free: 408 MB
node distances:
node 0 1
0: 10 20
1: 20 10
# numactl -show
policy: default
preferred node: current
physcpubind: 0 1 2 3 4 5 6 7
cpubind: 0 1
nodebind: 0 1
membind: 0 1
For RISC-V, the following qemu series is a pre-requisite to test the patches in Qemu.
https://patchwork.kernel.org/project/qemu-devel/list/?series=303313
The patches are also available at
https://github.com/atishp04/linux/tree/5.10_numa_unified
There may be some minor conflicts with Mike's cleanup series [2] depending on the
order in which these two series are being accepted. I can rebase on top his series
if required.
[2] https://lkml.org/lkml/2020/7/28/39
Atish Patra (5):
numa: Move numa implementation to common code
arm64, numa: Change the numa init function name to be generic
arm64, numa: Move pcibus_to_node definition to generic numa code
riscv: Separate memory init from paging init
riscv: Add numa support for riscv64 platform
Greentime Hu (1):
riscv: Add support pte_protnone and pmd_protnone if
CONFIG_NUMA_BALANCING
arch/arm64/Kconfig | 1 +
arch/arm64/include/asm/numa.h | 45 +---------------
arch/arm64/kernel/pci.c | 10 ----
arch/arm64/mm/Makefile | 1 -
arch/arm64/mm/init.c | 4 +-
arch/riscv/Kconfig | 31 ++++++++++-
arch/riscv/include/asm/mmzone.h | 13 +++++
arch/riscv/include/asm/numa.h | 8 +++
arch/riscv/include/asm/pci.h | 10 ++++
arch/riscv/include/asm/pgtable.h | 21 ++++++++
arch/riscv/kernel/setup.c | 12 ++++-
arch/riscv/kernel/smpboot.c | 12 ++++-
arch/riscv/mm/init.c | 10 +++-
drivers/base/Kconfig | 6 +++
drivers/base/Makefile | 1 +
.../mm/numa.c => drivers/base/arch_numa.c | 19 ++++++-
include/asm-generic/numa.h | 51 +++++++++++++++++++
17 files changed, 190 insertions(+), 65 deletions(-)
create mode 100644 arch/riscv/include/asm/mmzone.h
create mode 100644 arch/riscv/include/asm/numa.h
rename arch/arm64/mm/numa.c => drivers/base/arch_numa.c (97%)
create mode 100644 include/asm-generic/numa.h
--
2.24.0
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 <[email protected]>
---
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 <linux/acpi.h>
#include <linux/memblock.h>
#include <linux/module.h>
+#include <linux/pci.h>
#include <linux/of.h>
#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
+
static void numa_update_cpu(unsigned int cpu, bool remove)
{
int nid = cpu_to_node(cpu);
--
2.24.0
On Fri, 14 Aug 2020 14:47:22 -0700
Atish Patra <[email protected]> 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 <[email protected]>
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 <linux/acpi.h>
> #include <linux/memblock.h>
> #include <linux/module.h>
> +#include <linux/pci.h>
> #include <linux/of.h>
>
> #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
> +
> static void numa_update_cpu(unsigned int cpu, bool remove)
> {
> int nid = cpu_to_node(cpu);
On Fri, Aug 28, 2020 at 10:48:30AM +0100, Jonathan Cameron wrote:
> On Fri, 14 Aug 2020 14:47:22 -0700
> Atish Patra <[email protected]> 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 <[email protected]>
>
> 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 <linux/acpi.h>
> > #include <linux/memblock.h>
> > #include <linux/module.h>
> > +#include <linux/pci.h>
> > #include <linux/of.h>
> >
> > #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.
> > static void numa_update_cpu(unsigned int cpu, bool remove)
> > {
> > int nid = cpu_to_node(cpu);
>
>
On Fri, Aug 28, 2020 at 9:15 AM Bjorn Helgaas <[email protected]> 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 <[email protected]> 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 <[email protected]>
> >
> > 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 <linux/acpi.h>
> > > #include <linux/memblock.h>
> > > #include <linux/module.h>
> > > +#include <linux/pci.h>
> > > #include <linux/of.h>
> > >
> > > #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
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Regards,
Atish
On Fri, Aug 28, 2020 at 06:11:50PM -0700, Atish Patra wrote:
> On Fri, Aug 28, 2020 at 9:15 AM Bjorn Helgaas <[email protected]> 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 <[email protected]> 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 <[email protected]>
> > >
> > > 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 <linux/acpi.h>
> > > > #include <linux/memblock.h>
> > > > #include <linux/module.h>
> > > > +#include <linux/pci.h>
> > > > #include <linux/of.h>
> > > >
> > > > #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 ?
I didn't say it was *only* used by cpumask_of_pcibus(). 13 of the 29
calls are from cpumask_of_pcibus().
As you point out, there are a few drivers that use it. They typically
have a pci_dev, so they do the equivalent of pcibus_to_node(pdev->bus).
That seems silly; they should just do dev_to_node(&pdev->dev) instead.
I looked at this once, and it seems like there might have been a
wrinkle like the pdev->dev node not being set correctly or something.
If that's the case, I think it should be fixed.
> We can move the pcibus_to_node to arch specific code for now if that's
> what is preferred.
Now I'm the one who's confused :) Most arches, including arm64,
already have arch-specific implementations of pcibus_to_node(). I
didn't look at the rest of the series to see if there's a reason you
need to move pcibus_to_node() from arch/arm64/kernel/pci.c to
drivers//base/arch_numa.c. If you don't need to, I would just leave
it where it is.
> > > > static void numa_update_cpu(unsigned int cpu, bool remove)
> > > > {
> > > > int nid = cpu_to_node(cpu);
On Sat, Aug 29, 2020 at 7:54 PM Bjorn Helgaas <[email protected]> wrote:
>
> On Fri, Aug 28, 2020 at 06:11:50PM -0700, Atish Patra wrote:
> > On Fri, Aug 28, 2020 at 9:15 AM Bjorn Helgaas <[email protected]> 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 <[email protected]> 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 <[email protected]>
> > > >
> > > > 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 <linux/acpi.h>
> > > > > #include <linux/memblock.h>
> > > > > #include <linux/module.h>
> > > > > +#include <linux/pci.h>
> > > > > #include <linux/of.h>
> > > > >
> > > > > #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 ?
>
> I didn't say it was *only* used by cpumask_of_pcibus(). 13 of the 29
> calls are from cpumask_of_pcibus().
>
Ahh okay. Sorry I misunderstood that.
> As you point out, there are a few drivers that use it. They typically
> have a pci_dev, so they do the equivalent of pcibus_to_node(pdev->bus).
> That seems silly; they should just do dev_to_node(&pdev->dev) instead.
>
That covers the use case for ARM64. There are other arch implementations
as well which retrieve node information from sysdata which seems to be
type casted to different structures on different arch.
What should be done for those ?
> I looked at this once, and it seems like there might have been a
> wrinkle like the pdev->dev node not being set correctly or something.
> If that's the case, I think it should be fixed.
>
> > We can move the pcibus_to_node to arch specific code for now if that's
> > what is preferred.
>
> Now I'm the one who's confused :) Most arches, including arm64,
> already have arch-specific implementations of pcibus_to_node(). I
> didn't look at the rest of the series to see if there's a reason you
> need to move pcibus_to_node() from arch/arm64/kernel/pci.c to
> drivers//base/arch_numa.c. If you don't need to, I would just leave
> it where it is.
>
The reason I moved it from arch/arm64/kernel/pci.c to drivers//base/arch_numa.c.
so that we don't have to define it for RISC-V. But it's just a single
line function and
we can define it in RISC-V as well. I will try that in v2.
> > > > > static void numa_update_cpu(unsigned int cpu, bool remove)
> > > > > {
> > > > > int nid = cpu_to_node(cpu);
--
Regards,
Atish