Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Nimrod Oren <noren@nvidia.com>
Cc: David Hildenbrand <david@kernel.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>, Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>, Zi Yan <ziy@nvidia.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Nico Pache <nico.pache@linux.dev>,
	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>,
	Kiryl Shutsemau <kas@kernel.org>,
	Brendan Jackman <brendan.jackman@linux.dev>,
	Johannes Weiner <hannes@cmpxchg.org>,
	David Laight <david.laight.linux@gmail.com>,
	linux-mm@kvack.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: stop recalculating min_free_kbytes once set by userspace
Date: Thu, 15 Oct 2026 17:38:26 -0700	[thread overview]
Message-ID: <20261015173826.e7ffb7333fb84f5be927ae88@linux-foundation.org> (raw)
In-Reply-To: <26103c38-7b22-4176-8bc3-63e4b8fc6bbb@nvidia.com>

On Thu, 15 Oct 2026 19:16:40 +0300 Nimrod Oren <noren@nvidia.com> wrote:

> On 15/10/2026 0:48, Andrew Morton wrote:
> > On Wed, 14 Oct 2026 17:08:59 +0300 Nimrod Oren <noren@nvidia.com> wrote:
> > 
> >> min_free_kbytes is recalculated on memory hotplug and on THP sysfs
> >> writes. The new value comes from calculate_min_free_kbytes() or, while
> >> THP is enabled, from set_recommended_min_free_kbytes(). A value written
> >> to the vm.min_free_kbytes sysctl is replaced whenever the new value is
> >> higher, so a lower value does not stick. This matters most when THP is
> >> enabled on configurations with large pageblocks, where the new value
> >> can be excessive [1].
> >>
> >> Stop recalculating min_free_kbytes once a value has been written to the
> >> sysctl. Systems where the sysctl is never written keep the current
> >> behavior.
> > 
> > This problem lies somewhere in the range of "minor annoyance" to
> > "catastrophically horrible", but it isn't clear where in that range it
> > falls.
> > 
> > So can we please can we have a paragraph which explains the real-world
> > userspace-visible runtime effects of this problem?
> 
> Sure. Can we add the following after the first paragraph?
> 
>   For example, with default arm64 pageblock sizes, the THP
>   recommendation can reach 5.5 GiB per eligible zone with 64 KiB
>   pages vs 22 MiB with 4 KiB pages. This keeps a significant amount
>   of memory free, reducing what applications can use and triggering
>   reclaim much earlier. Users can lower vm.min_free_kbytes to avoid
>   this, but the lower value only sticks until the next recalculation.
> 

Thanks.

Do you (and others) feel that we should backport this?  Or is it just
not applicable to real-world users of older kernels?

If we expect there to be non-zero users of 64k-page kernels on older
versions then I think "yes, our users will benefit from this".



  reply	other threads:[~2026-10-16  0:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 14:08 [PATCH] mm: stop recalculating min_free_kbytes once set by userspace Nimrod Oren
2026-10-14 20:32 ` Johannes Weiner
2026-10-14 20:34 ` Zi Yan
2026-10-14 21:48 ` Andrew Morton
2026-10-15 16:16   ` Nimrod Oren
2026-10-16  0:38     ` Andrew Morton [this message]
2026-10-16  8:11       ` Lorenzo Stoakes (ARM)
2026-10-15  7:10 ` Vlastimil Babka (SUSE)
2026-10-15  9:19 ` Lorenzo Stoakes (ARM)

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=20261015173826.e7ffb7333fb84f5be927ae88@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=brendan.jackman@linux.dev \
    --cc=corbet@lwn.net \
    --cc=david.laight.linux@gmail.com \
    --cc=david@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=kas@kernel.org \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=nico.pache@linux.dev \
    --cc=noren@nvidia.com \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=skhan@linuxfoundation.org \
    --cc=surenb@google.com \
    --cc=usama.arif@linux.dev \
    --cc=vbabka@kernel.org \
    --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