From: Matthew Wilcox <willy@infradead.org>
To: wangchuanguo <wangchuanguo@inspur.com>
Cc: akpm@linux-foundation.org, mhiramat@kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: migrate: restore the nmask after successfully allocating on the target node
Date: Wed, 26 Mar 2025 03:28:58 +0000 [thread overview]
Message-ID: <Z-N0ep6Vv6D9QRik@casper.infradead.org> (raw)
In-Reply-To: <20250326031218.487450-1-wangchuanguo@inspur.com>
On Wed, Mar 26, 2025 at 11:12:18AM +0800, wangchuanguo wrote:
> If memory is successfully allocated on the target node and the
> function directly returns without value restore for nmask,
> non-first migration operations in migrate_pages() by again label
> may ignore the nmask settings, thereby allowing new memory
> allocations for migration on any node.
I have no opinion on whether this is the right thing to do or not, but
if it is:
> +++ b/mm/vmscan.c
> @@ -1026,8 +1026,10 @@ struct folio *alloc_migrate_folio(struct folio *src, unsigned long private)
> mtc->nmask = NULL;
> mtc->gfp_mask |= __GFP_THISNODE;
> dst = alloc_migration_target(src, (unsigned long)mtc);
> - if (dst)
> + if (dst) {
> + mtc->nmask = allowed_mask;
> return dst;
> + }
>
> mtc->gfp_mask &= ~__GFP_THISNODE;
> mtc->nmask = allowed_mask;
this should be:
dst = alloc_migration_target(src, (unsigned long)mtc);
+ mtc->nmask = allowed_mask;
if (dst)
return dst;
mtc->gfp_mask &= ~__GFP_THISNODE;
- mtc->nmask = allowed_mask;
next prev parent reply other threads:[~2025-03-26 3:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 3:12 [PATCH] mm: migrate: restore the nmask after successfully allocating on the target node wangchuanguo
2025-03-26 3:28 ` Matthew Wilcox [this message]
2025-03-28 13:44 ` Oscar Salvador
-- strict thread matches above, loose matches on Subject: below --
2025-03-26 5:54 Simon Wang (王传国)
2025-03-28 13:41 ` Oscar Salvador
2025-04-01 0:48 Simon Wang (王传国)
2025-04-01 1:06 Simon Wang (王传国)
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=Z-N0ep6Vv6D9QRik@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhiramat@kernel.org \
--cc=wangchuanguo@inspur.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.