From: yangshiguang <yangshiguang1011@163.com>
To: "Vlastimil Babka" <vbabka@suse.cz>
Cc: "David Rientjes" <rientjes@google.com>,
harry.yoo@oracle.com, akpm@linux-foundation.org, cl@gentwo.org,
roman.gushchin@linux.dev, glittao@gmail.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
yangshiguang <yangshiguang@xiaomi.com>,
stable@vger.kernel.org
Subject: Re:Re: [PATCH v4] mm: slub: avoid wake up kswapd in set_track_prepare
Date: Mon, 1 Sep 2025 16:29:02 +0800 (CST) [thread overview]
Message-ID: <11922bd5.7fae.1990464d9c8.Coremail.yangshiguang1011@163.com> (raw)
In-Reply-To: <7f30ddd1-c6f7-4b2b-a2b9-875844092e28@suse.cz>
At 2025-09-01 16:15:04, "Vlastimil Babka" <vbabka@suse.cz> wrote:
>On 9/1/25 09:50, David Rientjes wrote:
>> On Sat, 30 Aug 2025, yangshiguang1011@163.com wrote:
>>
>>> From: yangshiguang <yangshiguang@xiaomi.com>
>>>
>>> From: yangshiguang <yangshiguang@xiaomi.com>
>>>
>>
>> Duplicate lines.
>>
>>> set_track_prepare() can incur lock recursion.
>>> The issue is that it is called from hrtimer_start_range_ns
>>> holding the per_cpu(hrtimer_bases)[n].lock, but when enabled
>>> CONFIG_DEBUG_OBJECTS_TIMERS, may wake up kswapd in set_track_prepare,
>>> and try to hold the per_cpu(hrtimer_bases)[n].lock.
>>>
>>> Avoid deadlock caused by implicitly waking up kswapd by
>>> passing in allocation flags. And the slab caller context has
>>> preemption disabled, so __GFP_KSWAPD_RECLAIM must not appear in gfp_flags.
>>>
>>
>> This mentions __GFP_KSWAPD_RECLAIM, but the patch actually masks off
>> __GFP_DIRECT_RECLAIM which would be a heavierweight operation. Disabling
>> direct reclaim does not necessarily imply that kswapd will be disabled as
>> well.
>
>Yeah I think the changelog should say __GFP_DIRECT_RECLAIM.
>
>> Are you meaning to clear __GFP_RECLAIM in set_track_prepare()?
>
>No because if the context context (e.g. the hrtimers) can't support
>__GFP_KSWAPD_RECLAIM it won't have it in gfp_flags and we now pass them to
>set_track_prepare() so it already won't be there.
Sry. Should be __GFP_DIRECT_RECLAIM. I will resend the patch.
next prev parent reply other threads:[~2025-09-01 8:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-30 2:09 yangshiguang1011
2025-09-01 7:50 ` David Rientjes
2025-09-01 8:15 ` Vlastimil Babka
2025-09-01 8:29 ` yangshiguang [this message]
2025-09-01 8:46 ` Vlastimil Babka
2025-09-01 9:00 ` yangshiguang
2025-09-01 9:14 ` Vlastimil Babka
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=11922bd5.7fae.1990464d9c8.Coremail.yangshiguang1011@163.com \
--to=yangshiguang1011@163.com \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=glittao@gmail.com \
--cc=harry.yoo@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=stable@vger.kernel.org \
--cc=vbabka@suse.cz \
--cc=yangshiguang@xiaomi.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
all inboxes | Powered by JetHome®