Re: [RFC PATCH 02/11] mm/khugepaged: remove READ_ONLY_THP_FOR_FS code in collapse_file()
From: David Hildenbrand (Arm)
Date: Mon Mar 23 2026 - 15:41:48 EST
On 3/23/26 20:06, Zi Yan wrote:
> READ_ONLY_THP_FOR_FS is no longer present, remove corresponding code.
>
> Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
> ---
> mm/khugepaged.c | 159 +++++++++++-------------------------------------
> 1 file changed, 34 insertions(+), 125 deletions(-)
>
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index b2ac28ddd480..39f0b8959535 100644
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -1899,7 +1899,7 @@ static enum scan_result collapse_file(struct mm_struct *mm, unsigned long addr,
> int nr_none = 0;
> bool is_shmem = shmem_file(file);
>
> - VM_BUG_ON(!IS_ENABLED(CONFIG_READ_ONLY_THP_FOR_FS) && !is_shmem);
> + VM_WARN_ON_ONCE(!is_shmem);
Oh, but if that means that khugepaged cannot collapse large folios in
FSes anymore, then this is the wrong approach I suppose?
I would have assumed that we would now collapse for any files that
support large folios (in PMD size), not stopping to collapse entirely.
--
Cheers,
David