From: Johannes Weiner <hannes@cmpxchg.org>
To: Huang Ying <ying.huang@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Michal Hocko <mhocko@suse.com>, Rik van Riel <riel@surriel.com>,
Mel Gorman <mgorman@techsingularity.net>,
Peter Zijlstra <peterz@infradead.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Yang Shi <shy828301@gmail.com>, Zi Yan <ziy@nvidia.com>,
Wei Xu <weixugc@google.com>, osalvador <osalvador@suse.de>,
Shakeel Butt <shakeelb@google.com>,
Zhong Jiang <zhongjiang-ali@linux.alibaba.com>
Subject: Re: [PATCH -V3 0/3] memory tiering: hot page selection
Date: Tue, 14 Jun 2022 11:30:49 -0400 [thread overview]
Message-ID: <YqipqdGwNqQDxb/6@cmpxchg.org> (raw)
In-Reply-To: <20220614081635.194014-1-ying.huang@intel.com>
Hi Huang,
Have you had a chance to look at our hot page detection patch that
Hasan has sent out some time ago? [1]
It hooks into page reclaim to determine what is and isn't hot. Reclaim
is an existing, well-tested mechanism to do just that. It's just 13
lines of code: set active bit on the first hint fault; promote on the
second one if the active bit is still set. This promotes only pages
hot enough that they can compete with toptier access frequencies.
It's not just convenient, it's also essential to link tier promotion
rate to page aging. Tiered NUMA balancing is about establishing a
global LRU order across two (or more) nodes. LRU promotions *within* a
node require multiple LRU cycles with references. LRU promotions
*between* nodes must follow the same rules, and be subject to the same
aging pressure, or you can get much colder pages promoted into a very
hot workingset and wreak havoc.
We've hammered this patch quite extensively with several Meta
production workloads and it's been working reliably at keeping
reasonable promotion rates.
@@ -4202,6 +4202,19 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf)
last_cpupid = page_cpupid_last(page);
page_nid = page_to_nid(page);
+
+ /* Only migrate pages that are active on non-toptier node */
+ if (numa_promotion_tiered_enabled &&
+ !node_is_toptier(page_nid) &&
+ !PageActive(page)) {
+ count_vm_numa_event(NUMA_HINT_FAULTS);
+ if (page_nid == numa_node_id())
+ count_vm_numa_event(NUMA_HINT_FAULTS_LOCAL);
+ mark_page_accessed(page);
+ pte_unmap_unlock(vmf->pte, vmf->ptl);
+ goto out;
+ }
+
target_nid = numa_migrate_prep(page, vma, vmf->address, page_nid,
&flags);
pte_unmap_unlock(vmf->pte, vmf->ptl);
[1] https://lore.kernel.org/all/20211130003634.35468-1-hasanalmaruf@fb.com/t/#m85b95624622f175ca17a00cc8cc0fc9cc4eeb6d2
next prev parent reply other threads:[~2022-06-14 15:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-14 8:16 Huang Ying
2022-06-14 8:16 ` [PATCH -V3 1/3] memory tiering: hot page selection with hint page fault latency Huang Ying
2022-06-14 8:16 ` [PATCH -V3 2/3] memory tiering: rate limit NUMA migration throughput Huang Ying
2022-06-14 8:16 ` [PATCH -V3 3/3] memory tiering: adjust hot threshold automatically Huang Ying
2022-06-14 15:30 ` Johannes Weiner [this message]
2022-06-15 3:47 ` [PATCH -V3 0/3] memory tiering: hot page selection Ying Huang
2022-06-20 3:19 ` Baolin Wang
2022-06-20 3:24 ` Huang, Ying
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YqipqdGwNqQDxb/6@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=osalvador@suse.de \
--cc=peterz@infradead.org \
--cc=riel@surriel.com \
--cc=shakeelb@google.com \
--cc=shy828301@gmail.com \
--cc=weixugc@google.com \
--cc=ying.huang@intel.com \
--cc=zhongjiang-ali@linux.alibaba.com \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox