From: "Simon Wang (王传国)" <wangchuanguo@inspur.com>
To: Oscar Salvador <osalvador@suse.de>
Cc: Matthew Wilcox <willy@infradead.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"mhiramat@kernel.org" <mhiramat@kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: migrate: restore the nmask after successfully allocating on the target node
Date: Tue, 1 Apr 2025 00:48:43 +0000 [thread overview]
Message-ID: <bcc3284acf144b0a8c4f175a2f56b3d5@inspur.com> (raw)
> >
> > > 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
> > >
> >
> > I don't think so. When memory allocation fails on the target node, there is
> already a recovery operation for the nmask value below. Therefore, the nmask
> value should only be restored when memory allocation is successfully
> completed on the target node.
>
> But that is not what the code is doing, is it? With the changes applied I mean.
> You are restoring mtc->nmask in case you managed to allocate for
> __GFP_THISNODE and after you clear the flag, so we might as well do it just
> once at the beginning after calling alloc_migration_target for the first time.
>
>
> --
> Oscar Salvador
> SUSE Labs
Yes, you're right. My apologies—I overlooked a line of code earlier.
next reply other threads:[~2025-04-01 0:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 0:48 Simon Wang (王传国) [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-04-01 1:06 [PATCH] mm: migrate: restore the nmask after successfully allocating on the target node Simon Wang (王传国)
2025-03-26 5:54 Simon Wang (王传国)
2025-03-28 13:41 ` Oscar Salvador
2025-03-26 3:12 wangchuanguo
2025-03-26 3:28 ` Matthew Wilcox
2025-03-28 13:44 ` Oscar Salvador
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=bcc3284acf144b0a8c4f175a2f56b3d5@inspur.com \
--to=wangchuanguo@inspur.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhiramat@kernel.org \
--cc=osalvador@suse.de \
--cc=willy@infradead.org \
/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.