[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a0e586dc-dce6-41a2-9607-f2f64b752df1@redhat.com>
Date: Fri, 12 Sep 2025 09:53:02 +0200
From: David Hildenbrand <david@...hat.com>
To: "Luck, Tony" <tony.luck@...el.com>
Cc: Kyle Meyer <kyle.meyer@....com>, akpm@...ux-foundation.org,
corbet@....net, linmiaohe@...wei.com, shuah@...nel.org,
Liam.Howlett@...cle.com, bp@...en8.de, hannes@...xchg.org, jack@...e.cz,
jane.chu@...cle.com, jiaqiyan@...gle.com, joel.granados@...nel.org,
laoar.shao@...il.com, lorenzo.stoakes@...cle.com, mclapinski@...gle.com,
mhocko@...e.com, nao.horiguchi@...il.com, osalvador@...e.de,
rafael.j.wysocki@...el.com, rppt@...nel.org, russ.anderson@....com,
shawn.fan@...el.com, surenb@...gle.com, vbabka@...e.cz,
linux-acpi@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [PATCH] mm/memory-failure: Disable soft offline for HugeTLB pages
by default
On 11.09.25 19:56, Luck, Tony wrote:
> On Thu, Sep 11, 2025 at 10:46:10AM +0200, David Hildenbrand wrote:
>> On 10.09.25 18:15, Kyle Meyer wrote:
>>> Soft offlining a HugeTLB page reduces the available HugeTLB page pool.
>>> Since HugeTLB pages are preallocated, reducing the available HugeTLB
>>> page pool can cause allocation failures.
>>>
>>> /proc/sys/vm/enable_soft_offline provides a sysctl interface to
>>> disable/enable soft offline:
>>>
>>> 0 - Soft offline is disabled.
>>> 1 - Soft offline is enabled.
>>>
>>> The current sysctl interface does not distinguish between HugeTLB pages
>>> and other page types.
>>>
>>> Disable soft offline for HugeTLB pages by default (1) and extend the
>>> sysctl interface to preserve existing behavior (2):
>>>
>>> 0 - Soft offline is disabled.
>>> 1 - Soft offline is enabled (excluding HugeTLB pages).
>>> 2 - Soft offline is enabled (including HugeTLB pages).
>>>
>>> Update documentation for the sysctl interface, reference the sysctl
>>> interface in the sysfs ABI documentation, and update HugeTLB soft
>>> offline selftests.
>>
>> I'm sure you spotted that the documentation for
>> "/sys/devices/system/memory/soft_offline_pag" resides under "testing".
>
> But that is only one of several places in the kernel that
> feed into the page offline code.
Right, I can see one more call to soft_offline_page() from
arch/parisc/kernel/pdt.c.
And there is memory_failure_work_func() that I missed.
So agreed that this goes beyond testing.
It caught my attention because you ended up modifying documentation
residing in Documentation/ABI/testing/sysfs-memory-page-offline.
Reading 56374430c5dfc that Kyle pointed out is gets clearer.
So the patch motivation/idea makes sense to me.
I'll note two things:
(1) The interface design is not really extensible. Imagine if we want to
exclude yet another page type.
Can we maybe add a second interface that defines a filter for types?
Alternatively, you could use all the remaining flags as such a filter.
0 - Soft offline is completely disabled.
1 - Soft offline is enabled except for manually disabled types.
Filter
2 - disable hugetlb.
So value 3 would give you "enable all except hugetlb" etc.
We could add in the future
4 - disable guest_memfd (just some random example)
Then you
2) Changing the semantics of the value "1"
IIUC, you are changing the semantics of value "1". It used to mean
"SOFT_OFFLINE_ENABLED" now it is "SOFT_OFFLINE_ENABLED_SKIP_HUGETLB",
which is a change in behavior.
If that is the case, I don't think that's okay.
2) I am not sure about changing the default. That should be an admin/
distro decision.
--
Cheers
David / dhildenb
Powered by blists - more mailing lists