Thread (30 messages) 30 messages, 4 authors, 2025-08-13

Re: [PATCH v3 3/6] mm/huge_memory: respect MADV_COLLAPSE with PR_THP_DISABLE_EXCEPT_ADVISED

From: Baolin Wang <baolin.wang@linux.alibaba.com>
Date: 2025-08-05 01:49:53
Also in: linux-fsdevel, linux-mm, lkml


On 2025/8/4 23:40, Usama Arif wrote:
From: David Hildenbrand <redacted>

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.

Co-developed-by: Usama Arif <redacted>
Signed-off-by: Usama Arif <redacted>
Signed-off-by: David Hildenbrand <redacted>
---
LGTM.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help