Thread (41 messages) 41 messages, 5 authors, 2021-02-10

Re: [RFC][PATCH 08/13] mm/migrate: demote pages during reclaim

From: Dave Hansen <hidden>
Date: 2021-02-02 18:37:07
Also in: lkml

On 2/2/21 10:22 AM, Yang Shi wrote:
quoted
+static struct page *alloc_demote_page(struct page *page, unsigned long node)
+{
+        struct migration_target_control mtc = {
+               /*
+                * Fail quickly and quietly.  Page will likely
+                * just be discarded instead of migrated.
+                */
+               .gfp_mask = GFP_HIGHUSER | __GFP_NORETRY | __GFP_NOWARN,
+               .nid = node
+       };
+
+        return alloc_migration_target(page, (unsigned long)&mtc);
Other than the gfp flag question raised by Oscar, I'm wondering how we
guarantee the demotion allocation happens on the designated node. In
the previous version __GFP_THISNODE is set to guarantee this. In this
version you switched to use alloc_migration_target() API but without
having nodemask or __GFP_THISNODE. If nodemask is NULL the allocation
may fall back to an unexpected node.

And GFP_HIGHUSER does respect cpuset, so if the demotion target node
is excluded by the cpuset which the task belongs to, the migration
would fail. This might be a way to respect cpuset, but it should just
work for direct reclaimer. So, is this change really expected?
No, that wasn't intended.  I'll restore __GFP_THISNODE.  Thanks for
noting this.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help