[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <854ef84f-20ae-4985-9514-7f0616e0fc85@linux.alibaba.com>
Date: Tue, 8 Jul 2025 14:15:40 +0800
From: Baolin Wang <baolin.wang@...ux.alibaba.com>
To: Nico Pache <npache@...hat.com>, Andrew Morton
<akpm@...ux-foundation.org>, david@...hat.com, dev.jain@....com,
Hugh Dickins <hughd@...gle.com>
Cc: linux-mm@...ck.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
ziy@...dia.com, lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com,
ryan.roberts@....com, corbet@....net, rostedt@...dmis.org,
mhiramat@...nel.org, mathieu.desnoyers@...icios.com, baohua@...nel.org,
willy@...radead.org, peterx@...hat.com, wangkefeng.wang@...wei.com,
usamaarif642@...il.com, sunnanyong@...wei.com, vishal.moola@...il.com,
thomas.hellstrom@...ux.intel.com, yang@...amperecomputing.com,
kirill.shutemov@...ux.intel.com, aarcange@...hat.com, raquini@...hat.com,
anshuman.khandual@....com, catalin.marinas@....com, tiwai@...e.de,
will@...nel.org, dave.hansen@...ux.intel.com, jack@...e.cz, cl@...two.org,
jglisse@...gle.com, surenb@...gle.com, zokeefe@...gle.com,
hannes@...xchg.org, rientjes@...gle.com, mhocko@...e.com,
rdunlap@...radead.org
Subject: Re: [PATCH v8 11/15] khugepaged: allow madvise_collapse to check all
anonymous mTHP orders
On 2025/7/8 12:37, Nico Pache wrote:
> On Fri, Jul 4, 2025 at 3:14 PM Andrew Morton <akpm@...ux-foundation.org> wrote:
>>
>> On Fri, 4 Jul 2025 14:11:13 +0800 Baolin Wang <baolin.wang@...ux.alibaba.com> wrote:
>>
>>> On 2025/7/2 13:57, Nico Pache wrote:
>>>> Allow madvise_collapse to scan/collapse all mTHP orders without the
>>>> strict requirement of needing the PMD-order enabled.
>>>>
>>>> Signed-off-by: Nico Pache <npache@...hat.com>
>>>
>>> I am afraid we should drop this patch from the series, since Hugh
>>> explicitly opposed my modification of the madvise_collapse control logic
>>> in this thread[1].
>>
>> Well it drops easily enough. I don't know if it compiles yet.
>>
>> Nico, can you confirm that you're OK with the droppage and that the
>> series is still good without this patch?
> Yes that is fine, it shouldn't conflict at all. Although this isn't
> the only patch that will need modification... Ill reply to Baolin
> inline here.
>>
>>> Moreover, since we have not yet clarified how to handle the conflict
>>> between the semantics of madvise_collapse and the THP interfaces, we
>>> should keep the current logic[2] (means madvise_collapse still only
>>> allows PMD collapse).
> Hi Baolin,
>
> Sorry I saw most of that discussion but missed that point by David.
>
> We should come to an agreement on what the proper approach is, because
> if not we'll ALWAYS have this problem and NEVER solve it (pun
> intended).
>
> Jokes aside, if we are leaving MADV_COLLAPSE untouched then I need to
> make some slight modifications to this series so that MADV_COLLAPSE
> never tries anything other than PMD collapse (should be a pretty small
> change). Dropping this commit alone does not achieve that, but rather
> just allows MADV_COLLAPSE to work if PMD is disabled, and one other
> mTHP size is enabled. On second thought this isn't great either as
> MADV_COLLAPSE ignores sysfs, so if you have any mTHP size enabled, it
> will still continue to collapse to other PMD+mTHP sizes... wow this
> really is a mess.
Yes, this is what I mentioned earlier about the conflict between
MADV_COLLAPSE and mTHP collapse :(
>>> If madvise_collapse is to support mTHP collapse, there will be more
>>> semantic conflicts to discuss.
> I guess a V9 is inevitable, I will drop mTHP support for
> MADV_COLLAPSE, and drop this patch too. I'll let this series sit for a
> week or so to gather reviews (and make sure nothing else is missing).
Sure.
Powered by blists - more mailing lists