lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0c9f5b83-10db-460f-bdee-897396b49838@kernel.org>
Date: Thu, 13 Nov 2025 16:30:27 +0100
From: "David Hildenbrand (Red Hat)" <david@...nel.org>
To: "Garg, Shivank" <shivankg@....com>, Matthew Wilcox <willy@...radead.org>
Cc: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
 Andrew Morton <akpm@...ux-foundation.org>, Zi Yan <ziy@...dia.com>,
 Baolin Wang <baolin.wang@...ux.alibaba.com>,
 "Liam R . Howlett" <Liam.Howlett@...cle.com>, Nico Pache
 <npache@...hat.com>, Ryan Roberts <ryan.roberts@....com>,
 Dev Jain <dev.jain@....com>, Barry Song <baohua@...nel.org>,
 Lance Yang <lance.yang@...ux.dev>, Steven Rostedt <rostedt@...dmis.org>,
 Masami Hiramatsu <mhiramat@...nel.org>,
 Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
 Zach O'Keefe <zokeefe@...gle.com>, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
 Branden Moore <Branden.Moore@....com>
Subject: Re: [PATCH 1/2] mm/khugepaged: do synchronous writeback for
 MADV_COLLAPSE

On 11.11.25 06:58, Garg, Shivank wrote:
> 
> 
> On 11/10/2025 7:58 PM, Matthew Wilcox wrote:
>> On Mon, Nov 10, 2025 at 07:50:17PM +0530, Garg, Shivank wrote:
>>> The issue is copying those binary to a freshly mounted filesystem.
>>> The page cache folios remain dirty until background writeback completes.
>>>
>>> Reproduces 100% for me: fresh XFS/EXT4 mount -> copy binary -> execute -> MADV_COLLAPSE fails.
>>
>> Yes, but this is an uncommon thing to do.  Really, it's the kind of
>> thing you do when you're testing something (like, whether ext4 supports
>> large folios, and whether that yields a performance improvement).
>> It's more reasonable to change userspace than the kernel to solve this
>> problem you're having.
> 
> Fair point.
> 
> You're right that this is primarily a testing scenario, though it may also
> potentially affect JIT compilers writing executables (also uncommon) but more
> research is needed.
> 
> For userspace workarounds, calling fsync() before MADV_COLLAPSE works.

Right. But do we want document that any caller of MADV_COLLAPSE should 
issue an fsync() if MADV_COLLAPSE fails to try again?

IMHO this just reveals a problem that might also be triggered in a 
container that just got downloaded or after upgrading a package, no?

-- 
Cheers

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ