Re: [PATCH v5 05/14] mm: remove READ_ONLY_THP_FOR_FS Kconfig option

From: Lance Yang

Date: Thu May 07 2026 - 23:24:10 EST



On Fri, May 08, 2026 at 02:52:39AM +0000, Wei Yang wrote:
>On Wed, Apr 29, 2026 at 11:35:28AM -0400, Zi Yan wrote:
>>After removing READ_ONLY_THP_FOR_FS check in file_thp_enabled(),
>>khugepaged and MADV_COLLAPSE can run on FSes with PMD THP pagecache
>>support even without READ_ONLY_THP_FOR_FS enabled. Remove the Kconfig first
>>so that no one can use READ_ONLY_THP_FOR_FS as upcoming commits remove
>>mapping->nr_thps, which its safe guard mechanism relies on.
>>
>>Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
>>Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@xxxxxxxxxx>
>>Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
>>Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>
>>---
>> mm/Kconfig | 11 -----------
>> 1 file changed, 11 deletions(-)
>>
>>diff --git a/mm/Kconfig b/mm/Kconfig
>>index e221fa1dc54d0..27dc5b0139ba6 100644
>>--- a/mm/Kconfig
>>+++ b/mm/Kconfig
>>@@ -936,17 +936,6 @@ config THP_SWAP
>>
>> For selection by architectures with reasonable THP sizes.
>>
>>-config READ_ONLY_THP_FOR_FS
>>- bool "Read-only THP for filesystems (EXPERIMENTAL)"
>>- depends on TRANSPARENT_HUGEPAGE
>>-
>>- help
>>- Allow khugepaged to put read-only file-backed pages in THP.
>>-
>>- This is marked experimental because it is a new feature. Write
>>- support of file THPs will be developed in the next few release
>>- cycles.
>>-
>
>Hi,
>
>I see hugepage_enabled() in khugepaged.c still use READ_ONLY_THP_FOR_FS.
>

Yes, I noticed that[1] as well. Maybe it was dropped by accident :)

[1] https://lore.kernel.org/linux-mm/20260507044938.12529-1-lance.yang@xxxxxxxxx/