Re: [PATCH 7.2 v2 12/12] selftests/mm: remove READ_ONLY_THP_FOR_FS from comments in guard-regions

From: Zi Yan

Date: Tue Apr 14 2026 - 12:46:37 EST


On 14 Apr 2026, at 7:09, David Hildenbrand (Arm) wrote:

> On 4/14/26 00:28, Matthew Wilcox wrote:
>> On Mon, Apr 13, 2026 at 04:51:28PM -0400, Zi Yan wrote:
>>> On 13 Apr 2026, at 16:47, Matthew Wilcox wrote:
>>>
>>>>
>>>> Is this true? Does MADV_COLLAPSE refuse to work on writable files?
>>>> Should we delete some code here as well as fix the comment? ;-)
>>>
>>> file_thp_enabled() used by __thp_vma_allowable_orders() refuses
>>> writable files with inode_is_open_for_write(). That should prevent
>>> MADV_COLLAPSE from working on writable files.
>>
>> That sounds like more code that was added for RO_THP and should be
>> deleted? See commit e6be37b2e7bd
>
> Sounds like something to implement on top of this patch set?
>
> But with the added dirty checks in patch #2, maybe it's trivial to do it
> in this patchset already.

Can you two elaborate? The code from commit e6be37b2e7bd is moved around
and replaced by functions like __thp_vma_allowable_orders().

Best Regards,
Yan, Zi