From: John Garry <john.g.garry@oracle.com>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: kernel@xen0n.name, jiaxun.yang@flygoat.com,
tsbogend@alpha.franken.de, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
luto@kernel.org, peterz@infradead.org, arnd@arndb.de,
x86@kernel.org, loongarch@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org,
linux-arch@vger.kernel.org, vulab@iscas.ac.cn,
gregkh@linuxfoundation.org, rafael@kernel.org, dakr@kernel.org
Subject: Re: [PATCH 2/4] LoongArch: Make cpumask_of_node() robust against NUMA_NO_NODE
Date: Mon, 5 Jan 2026 14:09:18 +0000 [thread overview]
Message-ID: <e5dbec93-8400-4e20-a6f6-b245765144f5@oracle.com> (raw)
In-Reply-To: <CAAhV-H4e9NOuO0ZyYfa1W1CyDnJVuuUDNEOavMS9o+h-u8PzLw@mail.gmail.com>
On 05/01/2026 12:54, Huacai Chen wrote:
> Hi, John,
>
> On Mon, Jan 5, 2026 at 6:07 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 | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/loongarch/include/asm/topology.h b/arch/loongarch/include/asm/topology.h
>> index f06e7ff25bb7c..9857e4c20023c 100644
>> --- a/arch/loongarch/include/asm/topology.h
>> +++ b/arch/loongarch/include/asm/topology.h
>> @@ -12,7 +12,9 @@
>>
>> 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])
> You can define it in one line, so does the MIPS version.
>
ok, I can do it that way if you prefer. The reason I had it in flow was:
- a single line will overflow 80 characters, which some people still
prefer not doing
- following example of other archs and general coding style to split
macros functions across multiple lines.
Thanks,
John
next prev parent reply other threads:[~2026-01-05 14:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-05 10:05 [PATCH 0/4] Make cpumask_of_node() robust against NUMA_NO_NODE John Garry
2026-01-05 10:05 ` [PATCH 1/4] include/asm-generic/topology.h: Remove unused definition of cpumask_of_node() John Garry
2026-01-05 10:05 ` [PATCH 2/4] LoongArch: Make cpumask_of_node() robust against NUMA_NO_NODE John Garry
2026-01-05 12:54 ` Huacai Chen
2026-01-05 14:09 ` John Garry [this message]
2026-01-05 10:05 ` [PATCH 3/4] MIPS: Loongson: " John Garry
2026-01-05 10:05 ` [PATCH 4/4] x86/cpu/topology: " John Garry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e5dbec93-8400-4e20-a6f6-b245765144f5@oracle.com \
--to=john.g.garry@oracle.com \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=chenhuacai@kernel.org \
--cc=dakr@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=jiaxun.yang@flygoat.com \
--cc=kernel@xen0n.name \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=tglx@linutronix.de \
--cc=tsbogend@alpha.franken.de \
--cc=vulab@iscas.ac.cn \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox