From: David Hildenbrand <david@redhat.com>
To: Manish Kumar <manish1588@gmail.com>, akpm@linux-foundation.org
Cc: vbabka@suse.cz, surenb@google.com, mhocko@suse.com,
jackmanb@google.com, hannes@cmpxchg.org, ziy@nvidia.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/page_isolation: clarify FIXME around shrink_slab() in memory hotplug
Date: Mon, 20 Oct 2025 21:26:42 +0200 [thread overview]
Message-ID: <7e43294a-03d5-42e5-bec2-5fbcfab97b69@redhat.com> (raw)
In-Reply-To: <20251015175041.40408-1-manish1588@gmail.com>
On 15.10.25 19:50, Manish Kumar wrote:
> The existing FIXME comment notes that memory hotplug doesn't invoke
> shrink_slab() directly. This patch adds context explaining that this is
> an intentional design choice to avoid recursion or deadlocks in the
> memory reclaim path, as slab shrinking is handled by vmscan.
>
> Signed-off-by: Manish Kumar <manish1588@gmail.com>
> ---
> mm/page_isolation.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/mm/page_isolation.c b/mm/page_isolation.c
> index b2fc5266e3d2..2ca20c3f0a97 100644
> --- a/mm/page_isolation.c
> +++ b/mm/page_isolation.c
> @@ -176,10 +176,16 @@ static int set_migratetype_isolate(struct page *page, int migratetype, int isol_
>
> /*
> * FIXME: Now, memory hotplug doesn't call shrink_slab() by itself.
> - * We just check MOVABLE pages.
> + *
> + * This is an intentional limitation: invoking shrink_slab() from a
> + * hotplug path can cause reclaim recursion or deadlock if the normal
> + * memory reclaim (vmscan) path is already active. Slab shrinking is
> + * handled by the vmscan reclaim code under normal operation, so hotplug
> + * avoids direct calls into shrink_slab() to prevent reentrancy issues.
This is the first time I hear about this reentrance issue.
How did you come up with this explanation?
--
Cheers
David / dhildenb
next prev parent reply other threads:[~2025-10-20 19:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 17:50 Manish Kumar
2025-10-20 19:26 ` David Hildenbrand [this message]
2025-11-11 23:48 ` Andrew Morton
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=7e43294a-03d5-42e5-bec2-5fbcfab97b69@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=manish1588@gmail.com \
--cc=mhocko@suse.com \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=ziy@nvidia.com \
/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