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.

-- 
Cheers,

David

Reply via email to