Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: "Kiryl Shutsemau (Meta)" <kas@kernel.org>, Dev Jain <dev.jain@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	David Hildenbrand <david@kernel.org>,
	Harry Yoo <harry@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	Brendan Jackman <brendan.jackman@linux.dev>,
	Zi Yan <ziy@nvidia.com>, Lorenzo Stoakes <ljs@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Mike Rapoport <rppt@kernel.org>, Qi Zheng <qi.zheng@linux.dev>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	Kairui Song <kasong@tencent.com>, Barry Song <baohua@kernel.org>,
	Axel Rasmussen <axelrasmussen@google.com>,
	Yuanchu Xie <yuanchu@google.com>, Wei Xu <weixugc@google.com>,
	Baoquan He <baoquan.he@linux.dev>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Usama Arif <usama.arif@linux.dev>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH v3 2/3] mm: page_alloc: make the high-order watermark check honour ALLOC_NOFRAGMENT
Date: Mon, 23 Nov 2026 10:49:42 +0100	[thread overview]
Message-ID: <16e6001e-4e3a-4aac-8be4-05e754248f02@kernel.org> (raw)
In-Reply-To: <av7_n5llADUbJI-r@shutemov.name>

On 11/19/26 15:02, Kiryl Shutsemau (Meta) wrote:
> On Wed, Nov 18, 2026 at 01:40:17PM +0530, Dev Jain wrote:
>> So let us do something like: we have zone_watermark_ok_for_alloc. It will call
>> zone_watermark_ok, which will only handle the watermark computation (so this is a
>> refactor for the code ending at if (!order) line in current zone_watermark_ok).
>> Then it will also scan the freelists for the correct order, correct migratetype etc.
> 
> A count-only zone_watermark_ok() does not work for three callers that
> pass a high order: kswapd's pgdat_balanced(), kcompactd's
> __compact_finished() under defrag_mode, and should_reclaim_retry(). They
> ask whether the zone has a free page of that order regardless of
> migratetype. They need the free list scan without the migratetype
> filter, so neither of your two helpers fits them.
> 
> So the split is not count vs scan. It is the zone as a whole vs one
> request, as the comment above __zone_watermark_ok() says. The _mt variant
> is the one that takes the request's migratetype. Callers that only want
> the count already pass order 0.
> 
> I am not particularly tied to the _mt() name, but _for_alloc() is a
> mouthful.

Agreed. I've left it as is, we can cleanup later.



  reply	other threads:[~2026-11-23  9:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 12:50 [PATCH v3 0/3] mm: make watermark checks honour ALLOC_NOFRAGMENT Kiryl Shutsemau (Meta)
2026-11-16 12:50 ` [PATCH v3 1/3] mm: page_alloc: add a watermark check that knows the migratetype Kiryl Shutsemau (Meta)
2026-11-16 12:51 ` [PATCH v3 2/3] mm: page_alloc: make the high-order watermark check honour ALLOC_NOFRAGMENT Kiryl Shutsemau (Meta)
2026-11-17 12:51   ` sashiko-bot
2026-11-19 14:25     ` Kiryl Shutsemau (Meta)
2026-11-18  8:10   ` Dev Jain
2026-11-19 14:02     ` Kiryl Shutsemau (Meta)
2026-11-23  9:49       ` Vlastimil Babka (SUSE) [this message]
2026-11-16 12:51 ` [PATCH v3 3/3] mm: vmscan: tell direct reclaim the allocation is ALLOC_NOFRAGMENT Kiryl Shutsemau (Meta)
2026-11-23  9:48 ` [PATCH v3 0/3] mm: make watermark checks honour ALLOC_NOFRAGMENT Vlastimil Babka (SUSE)

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=16e6001e-4e3a-4aac-8be4-05e754248f02@kernel.org \
    --to=vbabka@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=baoquan.he@linux.dev \
    --cc=brendan.jackman@linux.dev \
    --cc=david@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=harry@kernel.org \
    --cc=kas@kernel.org \
    --cc=kasong@tencent.com \
    --cc=kernel-team@meta.com \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=qi.zheng@linux.dev \
    --cc=rppt@kernel.org \
    --cc=shakeel.butt@linux.dev \
    --cc=surenb@google.com \
    --cc=usama.arif@linux.dev \
    --cc=weixugc@google.com \
    --cc=yuanchu@google.com \
    --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