[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9afdbe8c-759b-48e4-9c64-099cf5b2d3cd@amd.com>
Date: Tue, 8 Jul 2025 09:13:39 +0530
From: Bharata B Rao <bharata@....com>
To: Byungchul Park <byungchul@...com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Jonathan.Cameron@...wei.com, dave.hansen@...el.com, gourry@...rry.net,
hannes@...xchg.org, mgorman@...hsingularity.net, mingo@...hat.com,
peterz@...radead.org, raghavendra.kt@....com, riel@...riel.com,
rientjes@...gle.com, sj@...nel.org, weixugc@...gle.com, willy@...radead.org,
ying.huang@...ux.alibaba.com, ziy@...dia.com, dave@...olabs.net,
nifan.cxl@...il.com, xuezhengchu@...wei.com, yiannis@...corp.com,
akpm@...ux-foundation.org, david@...hat.com, kernel_team@...ynix.com
Subject: Re: [RFC PATCH v1 3/4] mm: kmigrated - Async kernel migration thread
On 07-Jul-25 3:06 PM, Byungchul Park wrote:
> On Mon, Jun 16, 2025 at 07:09:30PM +0530, Bharata B Rao wrote:
>> +
>> +/*
>> + * Walks the PFNs of the zone, isolates and migrates them in batches.
>> + */
>> +static void kmigrated_walk_zone(unsigned long start_pfn, unsigned long end_pfn,
>> + int src_nid)
>> +{
>> + int nid, cur_nid = NUMA_NO_NODE;
>> + LIST_HEAD(migrate_list);
>> + int batch_count = 0;
>> + struct folio *folio;
>> + struct page *page;
>> + unsigned long pfn;
>> +
>> + for (pfn = start_pfn; pfn < end_pfn; pfn++) {
>
> Hi,
>
> Is it feasible to scan all the pages in each zone? I think we should
> figure out a better way so as to reduce CPU time for this purpose.
I incorporated a per-zone indicator to inform kmigrated if it needs to
skip the whole zone when scanning and look at only those zones which
have migrate-ready pages.
CPU time spent is one aspect, but the other aspect I have observed is
the delay in identifying migrate-ready pages depending on where they
exist in the zone. I have been seeing both best case and worst case
behaviors due to which the number of pages migrated for a given workload
can vary based on the given run.
Hence scanning all pages without additional smarts to quickly arrive
the pages of interest may not be ideal. I am working on approaches
to improve this situation.
>
> Besides the opinion above, I was thinking to design and implement a
> kthread for memory placement between different tiers - I already named
> it e.g. kmplaced, rather than relying on kswapd and hinting fault, lol ;)
>
> Now that you've started, I'd like to think about it together and improve
> it so that it works better. Please cc me from the next spin.
Sure, will do from next post.
Regards,
Bharata.
Powered by blists - more mailing lists