From: Donet Tom <donettom@linux.ibm.com>
To: Hannes Reinecke <hare@kernel.org>, David Hildenbrand <david@redhat.com>
Cc: Oscar Salvador <osalvador@suse.de>, linux-mm@kvack.org
Subject: Re: [PATCH 1/3] drivers/base/memory: add node id parameter to add_memory_block()
Date: Thu, 3 Jul 2025 17:29:35 +0530 [thread overview]
Message-ID: <bcb72937-c145-4803-83be-2cc50d3ef15b@linux.ibm.com> (raw)
In-Reply-To: <20250702073913.58247-2-hare@kernel.org>
On 7/2/25 1:09 PM, Hannes Reinecke wrote:
> Add a 'nid' parameter to add_memory_block() to initialize the memory
> block with the correct node id.
>
> Signed-off-by: Hannes Reinecke <hare@kernel.org>
> Acked-by: David Hildenbrand <david@redhat.com>
> Acked-by: Oscar Salvador <osalvador@suse.de>
> ---
> drivers/base/memory.c | 15 ++++-----------
> 1 file changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/base/memory.c b/drivers/base/memory.c
> index ed3e69dc785c..2b951e5f8a27 100644
> --- a/drivers/base/memory.c
> +++ b/drivers/base/memory.c
> @@ -822,7 +822,7 @@ void memory_block_add_nid(struct memory_block *mem, int nid,
> }
> #endif
>
> -static int add_memory_block(unsigned long block_id, unsigned long state,
> +static int add_memory_block(unsigned long block_id, int nid, unsigned long state,
> struct vmem_altmap *altmap,
> struct memory_group *group)
> {
> @@ -840,7 +840,7 @@ static int add_memory_block(unsigned long block_id, unsigned long state,
>
> mem->start_section_nr = block_id * sections_per_block;
> mem->state = state;
> - mem->nid = NUMA_NO_NODE;
> + mem->nid = nid;
> mem->altmap = altmap;
> INIT_LIST_HEAD(&mem->group_next);
>
> @@ -867,13 +867,6 @@ static int add_memory_block(unsigned long block_id, unsigned long state,
> return 0;
> }
>
> -static int add_hotplug_memory_block(unsigned long block_id,
> - struct vmem_altmap *altmap,
> - struct memory_group *group)
> -{
> - return add_memory_block(block_id, MEM_OFFLINE, altmap, group);
> -}
> -
> static void remove_memory_block(struct memory_block *memory)
> {
> if (WARN_ON_ONCE(memory->dev.bus != &memory_subsys))
> @@ -913,7 +906,7 @@ int create_memory_block_devices(unsigned long start, unsigned long size,
> return -EINVAL;
>
> for (block_id = start_block_id; block_id != end_block_id; block_id++) {
> - ret = add_hotplug_memory_block(block_id, altmap, group);
> + ret = add_memory_block(block_id, NUMA_NO_NODE, MEM_OFFLINE, altmap, group);
> if (ret)
> break;
> }
> @@ -1018,7 +1011,7 @@ void __init memory_dev_init(void)
> continue;
>
> block_id = memory_block_id(nr);
> - ret = add_memory_block(block_id, MEM_ONLINE, NULL, NULL);
> + ret = add_memory_block(block_id, NUMA_NO_NODE, MEM_ONLINE, NULL, NULL);
> if (ret) {
> panic("%s() failed to add memory block: %d\n",
> __func__, ret);
This looks good to me. Feel free to add
Reviewed-by: Donet Tom <donettom@linux.ibm.com>
next prev parent reply other threads:[~2025-07-03 11:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 7:39 [PATCHv2 0/3] mm/memory_hotplug: fixup crash during uevent handling Hannes Reinecke
2025-07-02 7:39 ` [PATCH 1/3] drivers/base/memory: add node id parameter to add_memory_block() Hannes Reinecke
2025-07-03 11:59 ` Donet Tom [this message]
2025-07-02 7:39 ` [PATCH 2/3] mm/memory_hotplug: activate node before adding new memory blocks Hannes Reinecke
2025-07-03 11:29 ` David Hildenbrand
2025-07-03 11:54 ` Hannes Reinecke
2025-07-03 18:49 ` David Hildenbrand
2025-07-04 6:09 ` Hannes Reinecke
2025-07-02 7:39 ` [PATCH 3/3] drivers/base: move memory_block_add_nid() into the caller Hannes Reinecke
2025-07-03 18:51 ` David Hildenbrand
2025-07-04 6:34 [PATCHv3 0/3] mm/memory_hotplug: fixup crash during uevent handling Hannes Reinecke
2025-07-04 6:34 ` [PATCH 1/3] drivers/base/memory: add node id parameter to add_memory_block() Hannes Reinecke
2025-07-29 6:46 [PATCHv4 0/3] mm/memory_hotplug: fixup crash during uevent handling Hannes Reinecke
2025-07-29 6:46 ` [PATCH 1/3] drivers/base/memory: add node id parameter to add_memory_block() Hannes Reinecke
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=bcb72937-c145-4803-83be-2cc50d3ef15b@linux.ibm.com \
--to=donettom@linux.ibm.com \
--cc=david@redhat.com \
--cc=hare@kernel.org \
--cc=linux-mm@kvack.org \
--cc=osalvador@suse.de \
/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