From: Muchun Song <muchun.song@linux.dev>
To: Donet Tom <donettom@linux.ibm.com>
Cc: Muchun Song <songmuchun@bytedance.com>,
David Hildenbrand <david@kernel.org>,
Oscar Salvador <osalvador@suse.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Lorenzo Stoakes <ljs@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
linux-mm@kvack.org, driver-core@lists.linux.dev,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-s390@vger.kernel.org
Subject: Re: [PATCH] drivers/base/memory: make memory block get/put explicit
Date: Tue, 12 May 2026 15:25:14 +0800 [thread overview]
Message-ID: <ACADAE38-650D-43D6-8000-891B59850499@linux.dev> (raw)
In-Reply-To: <943c5cd9-0796-45f5-9f8d-cb7e44457961@linux.ibm.com>
> On May 12, 2026, at 14:52, Donet Tom <donettom@linux.ibm.com> wrote:
>
> On 5/11/26 4:48 PM, Muchun Song wrote:
>
>> Rename the memory block lookup helper to make the acquired reference
>> explicit, add memory_block_put() to wrap put_device(), and collapse the
>> redundant section-number wrapper into a single block-id based lookup
>> interface.
>>
>> This makes it clearer to callers that a successful lookup holds a
>> reference that must be dropped, reducing the chance of forgetting the
>> matching put and leaking the memory block device reference.
>>
>> Link: https://lore.kernel.org/linux-mm/7887915D-E598-42B3-9AFE-BFFBACE8DE2D@linux.dev/#t
>> Signed-off-by: Muchun Song <songmuchun@bytedance.com>
>> ---
>> .../platforms/pseries/hotplug-memory.c | 14 ++-----
>> drivers/base/memory.c | 38 +++++++------------
>> drivers/base/node.c | 4 +-
>> drivers/s390/char/sclp_mem.c | 17 ++++-----
>> include/linux/memory.h | 7 +++-
>> mm/memory_hotplug.c | 5 +--
>> 6 files changed, 35 insertions(+), 50 deletions(-)
>
>
>
> Hi
>
> I did some basic DLPAR memory add/remove tests on PowerPC with this patch, and it is working fine.
>
> Initial memory
> ==============
> []# cat /proc/meminfo |grep -i MemTotal
> MemTotal: 205169920 kB
>
> After Add
> =========
> []# cat /proc/meminfo |grep -i MemTotal
> MemTotal: 247112960 kB
>
> After Remove
> ============
> []# cat /proc/meminfo |grep -i MemTotal
> MemTotal: 173729024 kB
> []#
>
> Tested-by: Donet Tom <donettom@linux.ibm.com>
Really thanks for your testing.
Thanks,
Muchun.
prev parent reply other threads:[~2026-05-12 7:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 11:18 [PATCH] drivers/base/memory: make memory block get/put explicit Muchun Song
2026-05-11 11:27 ` Michal Hocko
2026-05-11 12:14 ` Oscar Salvador
2026-05-11 12:22 ` David Hildenbrand (Arm)
2026-05-11 13:23 ` Muchun Song
2026-05-12 3:11 ` Muchun Song
2026-05-12 6:25 ` David Hildenbrand (Arm)
2026-05-11 13:48 ` Lorenzo Stoakes
2026-05-12 6:52 ` Donet Tom
2026-05-12 7:25 ` Muchun Song [this message]
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=ACADAE38-650D-43D6-8000-891B59850499@linux.dev \
--to=muchun.song@linux.dev \
--cc=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=borntraeger@linux.ibm.com \
--cc=chleroy@kernel.org \
--cc=dakr@kernel.org \
--cc=david@kernel.org \
--cc=donettom@linux.ibm.com \
--cc=driver-core@lists.linux.dev \
--cc=gor@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=hca@linux.ibm.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=ljs@kernel.org \
--cc=maddy@linux.ibm.com \
--cc=mhocko@suse.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=osalvador@suse.de \
--cc=rafael@kernel.org \
--cc=rppt@kernel.org \
--cc=songmuchun@bytedance.com \
--cc=surenb@google.com \
--cc=svens@linux.ibm.com \
--cc=vbabka@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.