Files
erofs-linux/include/uapi/linux
David Hildenbrand 8cdc4d2701 mm/huge_memory: respect MADV_COLLAPSE with PR_THP_DISABLE_EXCEPT_ADVISED
Let's allow for making MADV_COLLAPSE succeed on areas that neither have
VM_HUGEPAGE nor VM_NOHUGEPAGE when we have THP disabled unless explicitly
advised (PR_THP_DISABLE_EXCEPT_ADVISED).

MADV_COLLAPSE is a clear advice that we want to collapse.

Note that we still respect the VM_NOHUGEPAGE flag, just like
MADV_COLLAPSE always does. So consequently, MADV_COLLAPSE is now only
refused on VM_NOHUGEPAGE with PR_THP_DISABLE_EXCEPT_ADVISED,
including for shmem.

Link: https://lkml.kernel.org/r/[email protected]
Co-developed-by: Usama Arif <[email protected]>
Signed-off-by: Usama Arif <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
Reviewed-by: Baolin Wang <[email protected]>
Reviewed-by: Lorenzo Stoakes <[email protected]>
Reviewed-by: Zi Yan <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Barry Song <[email protected]>
Cc: Dev Jain <[email protected]>
Cc: Jann Horn <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Liam Howlett <[email protected]>
Cc: Mariano Pache <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Ryan Roberts <[email protected]>
Cc: SeongJae Park <[email protected]>
Cc: Shakeel Butt <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Yafang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
2025-09-13 16:55:05 -07:00
..
…
…
…
…
…
…
2025-02-08 15:16:29 +00:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-07-16 18:38:05 -07:00
…
…
…
…
…
…
…
…
…
…
…
2025-02-05 13:22:04 +09:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-02-12 02:29:30 +00:00
…
…
2025-06-24 16:58:42 +02:00
…
…
…
…
…
…
…
2025-05-03 12:02:09 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
2025-07-14 09:15:58 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-04-17 11:09:10 +02:00
…
…
…
…
…
…
…
…
…
…
2025-07-08 12:39:24 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-01-08 13:18:11 +01:00
…
…
…
…
…
2025-04-17 12:30:02 +02:00
…
…
…
…
…
…
…
2025-06-24 15:50:06 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-02-25 18:14:03 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
2025-07-14 18:41:42 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
2025-06-19 14:28:22 +02:00
…
…
…
2025-05-21 13:41:03 +02:00
…
…
…
…
…
…
2025-04-17 12:30:02 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-05-27 10:27:54 -04:00
…
…
…
…
…
…
…