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] [thread-next>] [day] [month] [year] [list]
Message-ID: <b06997d3-7668-4bcb-aa28-0eb75bea3dbe@lucifer.local>
Date: Wed, 25 Jun 2025 09:45:26 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: David Hildenbrand <david@...hat.com>
Cc: Hugh Dickins <hughd@...gle.com>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>, akpm@...ux-foundation.org,
        ziy@...dia.com, Liam.Howlett@...cle.com, npache@...hat.com,
        ryan.roberts@....com, dev.jain@....com, baohua@...nel.org,
        zokeefe@...gle.com, shy828301@...il.com, usamaarif642@...il.com,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 0/2] fix MADV_COLLAPSE issue if THP settings are
 disabled

On Wed, Jun 25, 2025 at 10:40:23AM +0200, David Hildenbrand wrote:
>
> I just looked at the original use cases [1], such a use case is not
> mentioned.
>
> But it did add process_madvise(MADV_COLLAPSE) in
> 876b4a1896646cc85ec6b1fc1c9270928b7e0831 where we document
>
> "
>     This is useful for the development of userspace agents that seek to
>     optimize THP utilization system-wide by using userspace signals to
>     prioritize what memory is most deserving of being THP-backed.
> "
>
> The "prioritize" might indicate that this is used in combination with
> "madvise", not with "never"/
>
>
> So yeah, it all boils down to
>
> (1) If there is no such use case, "never can mean never". Because there
>     is nothing to break, really.

Yeah and as I said in my first response to Hugh, I think the (unintentional)
vagueness of the docs means we are not breaking documented behaviour anyway.

>
> (2) If there is such a use case, we might be breaking it.
>
> [1]
> https://lore.kernel.org/linux-mm/20220706235936.2197195-1-zokeefe@google.com/

Agreed.

This speaks to the 'I want THP now' being the intent of MADV_COLLAPSE. Not a
never/manual (but immediate) control over THP assignment.

Which aligns with the docs:

"Perform a best-effort synchronous collapse of the native pages mapped by the
 memory range into Transparent Huge Pages (THPs)."

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ