The arch definition of cpumask_of_node() cannot handle NUMA_NO_NODE - which
is a valid index - so add a check for this.
Signed-off-by: John Garry <john.g.garry@oracle.com>
---
arch/loongarch/include/asm/topology.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/loongarch/include/asm/topology.h b/arch/loongarch/include/asm/topology.h
index f06e7ff25bb7c..6b79d6183085a 100644
--- a/arch/loongarch/include/asm/topology.h
+++ b/arch/loongarch/include/asm/topology.h
@@ -12,7 +12,7 @@
extern cpumask_t cpus_on_node[];
-#define cpumask_of_node(node) (&cpus_on_node[node])
+#define cpumask_of_node(node) ((node) == NUMA_NO_NODE ? cpu_all_mask : &cpus_on_node[node])
struct pci_bus;
extern int pcibus_to_node(struct pci_bus *);
--
2.43.5
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> On Wed, Jan 7, 2026 at 5:48 PM John Garry <john.g.garry@oracle.com> wrote: > > The arch definition of cpumask_of_node() cannot handle NUMA_NO_NODE - which > is a valid index - so add a check for this. > > Signed-off-by: John Garry <john.g.garry@oracle.com> > --- > arch/loongarch/include/asm/topology.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/loongarch/include/asm/topology.h b/arch/loongarch/include/asm/topology.h > index f06e7ff25bb7c..6b79d6183085a 100644 > --- a/arch/loongarch/include/asm/topology.h > +++ b/arch/loongarch/include/asm/topology.h > @@ -12,7 +12,7 @@ > > extern cpumask_t cpus_on_node[]; > > -#define cpumask_of_node(node) (&cpus_on_node[node]) > +#define cpumask_of_node(node) ((node) == NUMA_NO_NODE ? cpu_all_mask : &cpus_on_node[node]) > > struct pci_bus; > extern int pcibus_to_node(struct pci_bus *); > -- > 2.43.5 >
On 25/01/2026 03:55, Huacai Chen wrote: > Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> Thanks So can a loongarch maintainer pick this up please? > > On Wed, Jan 7, 2026 at 5:48 PM John Garry <john.g.garry@oracle.com> wrote: >> >> The arch definition of cpumask_of_node() cannot handle NUMA_NO_NODE - which >> is a valid index - so add a check for this. >> >> Signed-off-by: John Garry <john.g.garry@oracle.com> >> --- >> arch/loongarch/include/asm/topology.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/loongarch/include/asm/topology.h b/arch/loongarch/include/asm/topology.h >> index f06e7ff25bb7c..6b79d6183085a 100644 >> --- a/arch/loongarch/include/asm/topology.h >> +++ b/arch/loongarch/include/asm/topology.h >> @@ -12,7 +12,7 @@ >> >> extern cpumask_t cpus_on_node[]; >> >> -#define cpumask_of_node(node) (&cpus_on_node[node]) >> +#define cpumask_of_node(node) ((node) == NUMA_NO_NODE ? cpu_all_mask : &cpus_on_node[node]) >> >> struct pci_bus; >> extern int pcibus_to_node(struct pci_bus *); >> -- >> 2.43.5 >>
On Fri, Jan 30, 2026 at 8:21 PM John Garry <john.g.garry@oracle.com> wrote: > > On 25/01/2026 03:55, Huacai Chen wrote: > > Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> > > Thanks > > So can a loongarch maintainer pick this up please? OK, applied. Huacai > > > > > On Wed, Jan 7, 2026 at 5:48 PM John Garry <john.g.garry@oracle.com> wrote: > >> > >> The arch definition of cpumask_of_node() cannot handle NUMA_NO_NODE - which > >> is a valid index - so add a check for this. > >> > >> Signed-off-by: John Garry <john.g.garry@oracle.com> > >> --- > >> arch/loongarch/include/asm/topology.h | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/arch/loongarch/include/asm/topology.h b/arch/loongarch/include/asm/topology.h > >> index f06e7ff25bb7c..6b79d6183085a 100644 > >> --- a/arch/loongarch/include/asm/topology.h > >> +++ b/arch/loongarch/include/asm/topology.h > >> @@ -12,7 +12,7 @@ > >> > >> extern cpumask_t cpus_on_node[]; > >> > >> -#define cpumask_of_node(node) (&cpus_on_node[node]) > >> +#define cpumask_of_node(node) ((node) == NUMA_NO_NODE ? cpu_all_mask : &cpus_on_node[node]) > >> > >> struct pci_bus; > >> extern int pcibus_to_node(struct pci_bus *); > >> -- > >> 2.43.5 > >> >
© 2016 - 2026 Red Hat, Inc.