Re: [PATCH v4 0/2] fix MADV_COLLAPSE issue if THP settings are disabled

From: David Hildenbrand
Date: Wed Jun 25 2025 - 03:38:55 EST


On 25.06.25 09:30, Lorenzo Stoakes wrote:
On Wed, Jun 25, 2025 at 09:23:31AM +0200, David Hildenbrand wrote:
Well, one could argue we broke user space (admin settings) when we converted
"never" to no longer mean "never", but "never by page faults + khugepaged".
And we did so without updating the documentation.

I finally went back and checked the original discussions and, yes, this was
deliberate [1].

As so often, we created a mess with THP toggles.

I mean... !!!


Probably best to fixup the "never" documentation, and state that there is no
way to disable MADV_COLLAPSE anymore.

I disagree on the basis that system administrators will absolutely expect:

# echo never > /sys/kernel/mm/transparent-hugepage/enabled

To disable THP.

I _guarantee_ you that's what nearly everybody except a handful of people will
expect.

I know, See my other mail, the problem is rather if there is no somebody relying on never+MADV_COLLAPSE from doing the MADV_COLLAPSE-documented thing.

It's a mess.

(I have the suspicion that Hugh might know of such a user :) )


If we do decide to not do this series, _please_ can we seriously update the
documentation to be _absolutely crystal clear_ about this.

I will volunteer to do this in this case :)


I agree that if we want a way to disable all of them, we better have a
"deny" now. ... until someone else breaks that, then we can have a
"really_never_deny_all" etc. ;)

I really really dislike this. 'Deny' is weaker than 'never'. And now we have to
add even more complexity to the thing.

See my other mail, for shmem_enabled "deny" is stronger than "never", lol.

--
Cheers,

David / dhildenb