[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <05d60e72-3113-41f0-b81f-225397f06c81@arm.com>
Date: Fri, 30 May 2025 09:04:12 +0100
From: Ryan Roberts <ryan.roberts@....com>
To: Baolin Wang <baolin.wang@...ux.alibaba.com>, akpm@...ux-foundation.org,
hughd@...gle.com, david@...hat.com
Cc: lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com, npache@...hat.com,
dev.jain@....com, ziy@...dia.com, linux-mm@...ck.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/2] fix MADV_COLLAPSE issue if THP settings are disabled
On 29/05/2025 09:23, Baolin Wang wrote:
> As we discussed in the previous thread [1], the MADV_COLLAPSE will ignore
> the system-wide anon/shmem THP sysfs settings, which means that even though
> we have disabled the anon/shmem THP configuration, MADV_COLLAPSE will still
> attempt to collapse into a anon/shmem THP. This violates the rule we have
> agreed upon: never means never. This patch set will address this issue.
This is a drive-by comment from me without having the previous context, but...
Surely MADV_COLLAPSE *should* ignore the THP sysfs settings? It's a deliberate
user-initiated, synchonous request to use huge pages for a range of memory.
There is nothing *transparent* about it, it just happens to be implemented using
the same logic that THP uses.
I always thought this was a deliberate design decision.
Thanks,
Ryan
>
> [1] https://lore.kernel.org/all/1f00fdc3-a3a3-464b-8565-4c1b23d34f8d@linux.alibaba.com/
>
> Baolin Wang (2):
> mm: huge_memory: disallow hugepages if the system-wide THP sysfs
> settings are disabled
> mm: shmem: disallow hugepages if the system-wide shmem THP sysfs
> settings are disabled
>
> include/linux/huge_mm.h | 23 +++++++++++++++++++----
> mm/huge_memory.c | 2 +-
> mm/shmem.c | 12 ++++++------
> 3 files changed, 26 insertions(+), 11 deletions(-)
>
Powered by blists - more mailing lists