[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250313203607.zod6lssjef37ynbf@offworld>
Date: Thu, 13 Mar 2025 13:36:07 -0700
From: Davidlohr Bueso <dave@...olabs.net>
To: Bharata B Rao <bharata@....com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
AneeshKumar.KizhakeVeetil@....com, Hasan.Maruf@....com,
Jonathan.Cameron@...wei.com, Michael.Day@....com,
akpm@...ux-foundation.org, dave.hansen@...el.com, david@...hat.com,
feng.tang@...el.com, gourry@...rry.net, hannes@...xchg.org,
honggyu.kim@...com, hughd@...gle.com, jhubbard@...dia.com,
k.shutemov@...il.com, kbusch@...a.com, kmanaouil.dev@...il.com,
leesuyeon0506@...il.com, leillc@...gle.com, liam.howlett@...cle.com,
mgorman@...hsingularity.net, mingo@...hat.com, nadav.amit@...il.com,
nphamcs@...il.com, peterz@...radead.org, raghavendra.kt@....com,
riel@...riel.com, rientjes@...gle.com, rppt@...nel.org,
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, yuanchu@...gle.com,
hyeonggon.yoo@...com
Subject: Re: [RFC PATCH 2/4] mm: kpromoted: Hot page info collection and
promotion daemon
On Thu, 06 Mar 2025, Bharata B Rao wrote:
>+/*
>+ * Go thro' page hotness information and migrate pages if required.
>+ *
>+ * Promoted pages are not longer tracked in the hot list.
>+ * Cold pages are pruned from the list as well.
>+ *
>+ * TODO: Batching could be done
>+ */
>+static void kpromoted_migrate(pg_data_t *pgdat)
>+{
>+ int nid = pgdat->node_id;
>+ struct page_hotness_info *phi;
>+ struct hlist_node *tmp;
>+ int nr_bkts = HASH_SIZE(page_hotness_hash);
>+ int bkt;
>+
>+ for (bkt = 0; bkt < nr_bkts; bkt++) {
>+ mutex_lock(&page_hotness_lock[bkt]);
>+ hlist_for_each_entry_safe(phi, tmp, &page_hotness_hash[bkt], hnode) {
>+ if (phi->hot_node != nid)
>+ continue;
>+
>+ if (page_should_be_promoted(phi)) {
>+ count_vm_event(KPROMOTED_MIG_CANDIDATE);
>+ if (!kpromote_page(phi)) {
>+ count_vm_event(KPROMOTED_MIG_PROMOTED);
>+ hlist_del_init(&phi->hnode);
>+ kfree(phi);
>+ }
>+ } else {
>+ /*
>+ * Not a suitable page or cold page, stop tracking it.
>+ * TODO: Identify cold pages and drive demotion?
>+ */
I don't think kpromoted should drive demotion at all. No one is complaining about migrate
in lieu of discard, and there is also proactive reclaim which users can trigger. All the
in-kernel problems are wrt promotion. The simpler any of these kthreads are the better.
>+ count_vm_event(KPROMOTED_MIG_DROPPED);
>+ hlist_del_init(&phi->hnode);
>+ kfree(phi);
>+ }
>+ }
>+ mutex_unlock(&page_hotness_lock[bkt]);
>+ }
>+}
Powered by blists - more mailing lists