Re: [PATCH] mm: stop recalculating min_free_kbytes once set by userspace
From: Vlastimil Babka (SUSE)
Date: Thu Oct 15 2026 - 03:12:04 EST
On 10/14/26 16:08, Nimrod Oren 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.
>
> Link: https://lore.kernel.org/r/20260716173504.760369-1-noren@xxxxxxxxxx/ [1]
> Suggested-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
> Link: https://lore.kernel.org/r/d202dcc3-d7d7-4e98-a9a5-3137cfbfd041@xxxxxxxxxx/
> Signed-off-by: Nimrod Oren <noren@xxxxxxxxxx>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
Thanks!