From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: Huacai Chen <chenhuacai@kernel.org>, maobibo <maobibo@loongson.cn>
Cc: loongson-kernel@lists.loongnix.cn, loongarch@lists.linux.dev,
Xuefeng Li <lixuefeng@loongson.cn>, Guo Ren <guoren@kernel.org>,
Xuerui Wang <kernel@xen0n.name>,
linux-kernel@vger.kernel.org,
Huacai Chen <chenhuacai@loongson.cn>
Subject: Re: [PATCH] LoongArch: Let cores_io_master cover the largest NR_CPUS
Date: Mon, 25 Dec 2023 14:02:36 +0000 [thread overview]
Message-ID: <b239bfee-73a7-495d-b094-bdfa31c1500e@flygoat.com> (raw)
In-Reply-To: <CAAhV-H5Rs4BGKHZrA5bxSh0=4uhPx7vbVwBXtdtfU4hemN2QjA@mail.gmail.com>
在 2023/12/25 09:19, Huacai Chen 写道:
> On Mon, Dec 25, 2023 at 5:13 PM maobibo <maobibo@loongson.cn> wrote:
>>
>>
>>
>> On 2023/12/25 下午3:00, Huacai Chen wrote:
>>> Now loongson_system_configuration::cores_io_master only covers 64 cpus,
>>> if NR_CPUS > 64 there will be memory corruption. So let cores_io_master
>>> cover the largest NR_CPUS (256).
>>>
>>> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
>>> ---
>>> arch/loongarch/include/asm/bootinfo.h | 4 ++--
>>> arch/loongarch/kernel/acpi.c | 2 +-
>>> arch/loongarch/kernel/smp.c | 2 +-
>>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/arch/loongarch/include/asm/bootinfo.h b/arch/loongarch/include/asm/bootinfo.h
>>> index c60796869b2b..32fd0319594a 100644
>>> --- a/arch/loongarch/include/asm/bootinfo.h
>>> +++ b/arch/loongarch/include/asm/bootinfo.h
>>> @@ -30,7 +30,7 @@ struct loongson_system_configuration {
>>> int boot_cpu_id;
>>> int cores_per_node;
>>> int cores_per_package;
>>> - unsigned long cores_io_master;
>>> + unsigned long cores_io_master[4];
>> Can the hardcoded 4 be defined something like this?
>> DIV_ROUND_UP(CONFIG_NR_CPUS, sizeof(long))
> Can this be used to define arrays?
I think DECLARE_BITMAP should work.
See how are we dealing with cpumask_t:
```
typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
```
Thanks
- Jiaxun
[...]
>
> Huacai
next prev parent reply other threads:[~2023-12-25 14:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-25 7:00 Huacai Chen
2023-12-25 9:13 ` maobibo
2023-12-25 9:19 ` Huacai Chen
2023-12-25 11:11 ` Xi Ruoyao
2023-12-25 14:02 ` Jiaxun Yang [this message]
2023-12-27 1:09 ` maobibo
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=b239bfee-73a7-495d-b094-bdfa31c1500e@flygoat.com \
--to=jiaxun.yang@flygoat.com \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=guoren@kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=loongarch@lists.linux.dev \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=maobibo@loongson.cn \
/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
all inboxes | Powered by JetHome®