public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Matthew Brost" <matthew.brost@intel.com>
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH v2 1/5] mm: Introduce zone_appears_fragmented()
Date: Fri, 24 Apr 2026 09:26:18 +0200	[thread overview]
Message-ID: <a1252167-63a1-481b-9f1d-2a7bae7a3b6c@kernel.org> (raw)
In-Reply-To: <291406b26b8badf2e565996515931d9ebe50208f.camel@linux.intel.com>

On 4/24/26 09:05, Thomas Hellström wrote:
> On Thu, 2026-04-23 at 15:21 -0700, Matthew Brost wrote:
>> On Thu, Apr 23, 2026 at 12:08:36PM -0700, Matthew Brost wrote:
>>>
>>> If the order were included in shrink_control, there is about a 95%
>>> certain that this change would allow TTM / Xe to break the
>>> problematic
>>> kswapd feedback loop. This may also better express the intent of
>>> the
>>> problem we are trying to fix here.
>>>
>>> For reference, the cover letter [1] details the problem.
>>>
>>> Any guidance from the core MM folks would be appreciated—would
>>> adding
>>> the order to shrink_control be an acceptable solution?
>>>
>>> Matt
>>>
>>> [1] https://patchwork.freedesktop.org/series/165330/
>>>
>>
>> It doesn't look like __GFP_NORETRY, __GFP_RETRY_MAYFAIL, __GFP_NOFAIL
>> make it to the sc->gfp_mask flags from the caller and get into kswapd
>> loop...
> 
> Perhaps that's because they mostly (only?) make sense from direct
> reclaim? Looks like the trace is from kswapd.

kswap obtains the desired order through pgdat->kswapd_order, as a hint from
allocation code (wakeup_kswapd). The order can be easily merged (just use the max)

We do have the gfp_flags there, but merging them from different wakeups is a bit
more tricky (and when to reset?).

Assume we have one urgent request for order-0 and one non-urgent
(noretry,nofail, ...) request for order-9, we'd have to figure out a way how to
represent that. Gets more complicated for more orders.

Of course, we could have some kind of array, and try to store some "priority"
per order. But I assume plumbing that into the rest of kswapd might not be that
easy.


-- 
Cheers,

David


  reply	other threads:[~2026-04-24  7:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23  5:56 [PATCH v2 0/5] mm, drm/ttm, drm/xe: Avoid reclaim/eviction loops under fragmentation Matthew Brost
2026-04-23  5:56 ` [PATCH v2 1/5] mm: Introduce zone_appears_fragmented() Matthew Brost
2026-04-23  6:04   ` Balbir Singh
2026-04-23  6:16     ` Matthew Brost
2026-04-23  6:27       ` Matthew Brost
2026-04-23 10:27   ` David Hildenbrand (Arm)
2026-04-23 11:27     ` Thomas Hellström
2026-04-23 19:08       ` Matthew Brost
2026-04-23 22:21         ` Matthew Brost
2026-04-24  7:05           ` Thomas Hellström
2026-04-24  7:26             ` David Hildenbrand (Arm) [this message]
2026-04-30  2:47               ` Matthew Brost
2026-04-30  7:47                 ` Thomas Hellström
2026-04-30 16:34                   ` Matthew Brost
2026-04-30 19:59                     ` Thomas Hellström
2026-04-30 17:06                   ` Vlastimil Babka (SUSE)
2026-04-28  9:51   ` Andi Shyti
2026-04-28 10:05     ` Andi Shyti
2026-04-30  2:34       ` Matthew Brost
2026-04-30  2:37     ` Matthew Brost

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=a1252167-63a1-481b-9f1d-2a7bae7a3b6c@kernel.org \
    --to=david@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hannes@cmpxchg.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=matthew.brost@intel.com \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=thomas.hellstrom@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox