[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <95242ba0-e7a6-40c4-ae43-dab2d61555b6@amd.com>
Date: Tue, 8 Jul 2025 16:47:00 +0530
From: Raghavendra K T <raghavendra.kt@....com>
To: Harry Yoo <harry.yoo@...cle.com>
Cc: AneeshKumar.KizhakeVeetil@....com, Hasan.Maruf@....com,
Michael.Day@....com, akpm@...ux-foundation.org, bharata@....com,
dave.hansen@...el.com, david@...hat.com, dongjoo.linux.dev@...il.com,
feng.tang@...el.com, gourry@...rry.net, hannes@...xchg.org,
honggyu.kim@...com, hughd@...gle.com, jhubbard@...dia.com,
jon.grimm@....com, k.shutemov@...il.com, kbusch@...a.com,
kmanaouil.dev@...il.com, leesuyeon0506@...il.com, leillc@...gle.com,
liam.howlett@...cle.com, linux-kernel@...r.kernel.org, linux-mm@...ck.org,
mgorman@...hsingularity.net, mingo@...hat.com, nadav.amit@...il.com,
nphamcs@...il.com, peterz@...radead.org, riel@...riel.com,
rientjes@...gle.com, rppt@...nel.org, santosh.shukla@....com,
shivankg@....com, shy828301@...il.com, sj@...nel.org, vbabka@...e.cz,
weixugc@...gle.com, willy@...radead.org, ying.huang@...ux.alibaba.com,
ziy@...dia.com, Jonathan.Cameron@...wei.com, dave@...olabs.net,
yuanchu@...gle.com, kinseyho@...gle.com, hdanton@...a.com
Subject: Re: [RFC PATCH V2 03/13] mm: Scan the mm and create a migration list
On 6/26/2025 11:57 AM, Raghavendra K T wrote:
>
> On 6/26/2025 3:37 AM, Harry Yoo wrote:
>> On Tue, Jun 24, 2025 at 05:56:07AM +0000, Raghavendra K T wrote:
>>> Since we already have the list of mm_struct in the system, add a
>>> module to
>>> scan each mm that walks VMAs of each mm_struct and scan all the pages
>>> associated with that.
>>>
>>> In the scan path: Check for the recently acccessed pages (folios)
>>> belonging
>>> to slowtier nodes. Add all those folios to a list.
>>>
>>> Signed-off-by: Raghavendra K T <raghavendra.kt@....com>
>>> ---
>>
>> Hi, just taking a quick look...
>
> Hello Harry,
> Thanks for taking a look at the patches.
>>
>>> mm/kscand.c | 319 +++++++++++++++++++++++++++++++++++++++++++++++++++-
>>> 1 file changed, 318 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/mm/kscand.c b/mm/kscand.c
>>> index d5b0d3041b0f..0edec1b7730d 100644
>>> --- a/mm/kscand.c
>>> +++ b/mm/kscand.c
>>> @@ -42,6 +55,8 @@ static struct kmem_cache *kscand_slot_cache
>>> __read_mostly;
>>> @@ -84,11 +122,275 @@ static void kscand_wait_work(void)
>>> scan_sleep_jiffies);
>>> }
>>> +static inline bool is_valid_folio(struct folio *folio)
>>> +{
>>> + if (!folio || folio_test_unevictable(folio) || !
>>> folio_mapped(folio) ||
>>> + folio_is_zone_device(folio) ||
>>> folio_maybe_mapped_shared(folio))
>>> + return false;
>>> +
>>> + return true;
>>> +}
>>
>> What makes it undesirable to migrate shared folios?
>
> This was mostly to avoid shared libraries, but yes this also
> should have accompanied with EXEC flag to refine further.
> This also avoids moving around shared data. I will experiment more
> and add additional filters OR remove the check.
>
Atleast experiment with microbenchmark gives a positive benefit if I
remove check for folio_maybe_mapped_shared() folios. Will respin
accordingly.
(also after checking some real workloads).
- Raghu
Powered by blists - more mailing lists