From: Wei Yang <richardw.yang@linux.intel.com>
To: Yang Shi <yang.shi@linux.alibaba.com>
Cc: mhocko@suse.com, richardw.yang@linux.intel.com,
akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] mm: move_pages: fix the return value if there are not-migrated pages
Date: Sun, 19 Jan 2020 10:37:20 +0800 [thread overview]
Message-ID: <20200119023720.GD9745@richard> (raw)
In-Reply-To: <1579325203-16405-1-git-send-email-yang.shi@linux.alibaba.com>
On Sat, Jan 18, 2020 at 01:26:43PM +0800, Yang Shi wrote:
>The do_move_pages_to_node() might return > 0 value, the number of pages
>that are not migrated, then the value will be returned to userspace
>directly. But, move_pages() syscall would just return 0 or errno. So,
>we need reset the return value to 0 for such case as what pre-v4.17 did.
>
>Fixes: a49bd4d71637 ("mm, numa: rework do_pages_move")
>Cc: Michal Hocko <mhocko@suse.com>
>Cc: Wei Yang <richardw.yang@linux.intel.com>
>Cc: <stable@vger.kernel.org> [4.17+]
>Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
>---
> mm/migrate.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
>diff --git a/mm/migrate.c b/mm/migrate.c
>index 86873b6..3e75432 100644
>--- a/mm/migrate.c
>+++ b/mm/migrate.c
>@@ -1659,8 +1659,11 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes,
> goto out_flush;
>
> err = do_move_pages_to_node(mm, &pagelist, current_node);
>- if (err)
>+ if (err) {
>+ if (err > 0)
>+ err = 0;
> goto out;
>+ }
> if (i > start) {
> err = store_status(status, start, current_node, i - start);
> if (err)
>--
>1.8.3.1
Hey, I am afraid you missed something. There are three calls of
do_move_pages_to_node() in do_pages_move(). Why you just handle one return
value? How about the other two?
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2020-01-19 2:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-18 5:26 [PATCH] mm: move_pages: fix the return value if there are not-migrated pages Yang Shi
2020-01-19 2:37 ` Wei Yang [this message]
2020-01-19 2:57 ` Wei Yang
2020-01-19 5:47 ` Yang Shi
2020-01-19 5:44 ` Yang Shi
2020-01-20 13:06 ` Michal Hocko
2020-01-20 13:17 ` Michal Hocko
2020-01-21 1:44 ` Wei Yang
2020-01-21 8:40 ` Michal Hocko
2020-01-21 19:01 ` Yang Shi
2020-01-22 8:06 ` Michal Hocko
2020-01-22 17:26 ` Yang Shi
2020-01-22 17:35 ` Michal Hocko
2020-01-23 3:29 ` Wei Yang
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=20200119023720.GD9745@richard \
--to=richardw.yang@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=stable@vger.kernel.org \
--cc=yang.shi@linux.alibaba.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;
as well as URLs for NNTP newsgroup(s).