Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nimrod Oren <noren@nvidia.com>
To: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>, Zi Yan <ziy@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@kernel.org>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	"Liam R. Howlett" <liam@infradead.org>,
	Nico Pache <npache@redhat.com>,
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>,
	Usama Arif <usama.arif@linux.dev>,
	Liu Song <liusong@linux.alibaba.com>,
	Hao Peng <flyingpenghao@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] mm/khugepaged: cap pageblock contribution to min_free_kbytes
Date: Tue, 28 Jul 2026 21:31:01 +0300	[thread overview]
Message-ID: <69b16c76-c46f-48a4-982c-b762b31ffe74@nvidia.com> (raw)
In-Reply-To: <amc0w1IQAhHND1Dr@lucifer>

On 27/07/2026 13:52, Lorenzo Stoakes (ARM) wrote:
> On Fri, Jul 17, 2026 at 10:58:45AM -0400, Zi Yan wrote:
>> On 17 Jul 2026, at 9:36, Lorenzo Stoakes (ARM) wrote:
>>> Maybe a simpler version would be to just attack the issue we actually have
>>> with it - it uses too much damn memory :)
>>>
>>> So maybe something like the attached? (you'd probably want to make this a
>>> sysctl or at least a defined value of course)
>>
>> The approach below makes sense to me. In terms of the actual cap size,
>> I asked Codex to check what possible pageblock_size and their reserved
>> sizes:
>>
>> 1. 1MB pageblock size (s390) and 11MB per zone,
>> 2. 2MB pageblock size and 22MB per zone,
>> 3. 8MB pageblock size and 88MB per zone,
>> 4. 16MB pageblock size and 176MB per zone,
>> 5. 32MB pageblock size and 352MB per zone,
>> 6. 128MB pageblock size and 1.375GB per zone,
>> 7. 512MB pageblock size and 5.5GB per zone.
>>
>> 1GB makes sense to me. 512MB might also work.
> 
> Yeah I felt this was a bit of a 'dumb' solution but ultimately if we are
> saying 'restrict how much memory this uses to something sane' then that's
> what we should just do.
> 
> It might be a good bandaid at least for this issue which is ongoing, well
> known, and painful.
> 
> I think at 352MB per zone and 2-3 zones for 32 MiB pageblock, plus reserves
> of 2*512 MiB for 512 MiB pageblock makes 1 GiB a sensible choice here
> overall.


It's worth noting that while users who need more headroom can simply
raise min_free_kbytes further via sysctl, those who wish to lower the
value can't set it persistently since set_recommended_min_free_kbytes()
may raise it back to the recommended value.

I think 1 GiB sounds good, but given this behavior where raising is more
accessible than lowering, I wonder if we should opt for a lower value.

A new sysctl for the cap could address this, but I'm not sure whether
adding one would be justified.



      reply	other threads:[~2026-07-28 18:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 17:35 [RFC PATCH] mm/khugepaged: cap pageblock contribution to min_free_kbytes Nimrod Oren
2026-07-17 13:36 ` Lorenzo Stoakes (ARM)
2026-07-17 14:58   ` Zi Yan
2026-07-20  7:28     ` Nimrod Oren
2026-07-27 10:54       ` Lorenzo Stoakes (ARM)
2026-07-27 10:52     ` Lorenzo Stoakes (ARM)
2026-07-28 18:31       ` Nimrod Oren [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=69b16c76-c46f-48a4-982c-b762b31ffe74@nvidia.com \
    --to=noren@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=flyingpenghao@gmail.com \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liusong@linux.alibaba.com \
    --cc=ljs@kernel.org \
    --cc=npache@redhat.com \
    --cc=ryan.roberts@arm.com \
    --cc=usama.arif@linux.dev \
    --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