From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: Tiezhu Yang <yangtiezhu@loongson.cn>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Xuefeng Li <lixuefeng@loongson.cn>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] MIPS: Use memblock_add_node() in early_parse_mem() under CONFIG_NUMA
Date: Tue, 22 Mar 2022 13:19:01 +0000 [thread overview]
Message-ID: <33241bd3-2f12-954c-6701-56cf563060bb@flygoat.com> (raw)
In-Reply-To: <1647615920-23103-4-git-send-email-yangtiezhu@loongson.cn>
在 2022/3/18 15:05, Tiezhu Yang 写道:
> Use memblock_add_node to add new memblock region within a NUMA node
> in early_parse_mem() under CONFIG_NUMA, otherwise the mem parameter
> can not work well.
Hi Tiezhu,
pa_to_nid doesn't exist when CONFIG_NUME is disabled.
So probably you want #ifdef macro instead ?
Thanks.
- Jiaxun
>
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
> arch/mips/kernel/setup.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index c8c8f60..50cdc08 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -37,6 +37,7 @@
> #include <asm/cdmm.h>
> #include <asm/cpu.h>
> #include <asm/debug.h>
> +#include <asm/mmzone.h>
> #include <asm/sections.h>
> #include <asm/setup.h>
> #include <asm/smp-ops.h>
> @@ -378,7 +379,10 @@ static int __init early_parse_mem(char *p)
> memblock_end_of_DRAM() - memblock_start_of_DRAM());
> }
>
> - memblock_add(start, size);
> + if (IS_ENABLED(CONFIG_NUMA))
> + memblock_add_node(start, size, pa_to_nid(start), MEMBLOCK_NONE);
> + else
> + memblock_add(start, size);
>
> return 0;
> }
next prev parent reply other threads:[~2022-03-22 13:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 15:05 [PATCH 0/3] MIPS: Modify early_parse_mem() Tiezhu Yang
2022-03-18 15:05 ` [PATCH 1/3] MIPS: Return -EINVAL if mem parameter is empty in early_parse_mem() Tiezhu Yang
2022-03-18 15:05 ` [PATCH 2/3] MIPS: Return -EINVAL if mem parameter is invalid " Tiezhu Yang
2022-03-18 15:05 ` [PATCH 3/3] MIPS: Use memblock_add_node() in early_parse_mem() under CONFIG_NUMA Tiezhu Yang
2022-03-22 13:19 ` Jiaxun Yang [this message]
2022-03-23 2:42 ` Tiezhu Yang
2022-03-24 12:29 ` Jiaxun Yang
2022-05-09 7:30 ` [PATCH 0/3] MIPS: Modify early_parse_mem() Tiezhu Yang
2022-05-23 13:28 ` Thomas Bogendoerfer
2022-05-24 2:01 ` Tiezhu Yang
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=33241bd3-2f12-954c-6701-56cf563060bb@flygoat.com \
--to=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=tsbogend@alpha.franken.de \
--cc=yangtiezhu@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