Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1094149ybl; Sat, 18 Jan 2020 18:38:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxfrght6+DyZ1jH4biCKIYXif7IMnrKcFj+WJrE7W4mCT128kqjzDkvk5FIY8TQZ23d7EtD X-Received: by 2002:a05:6808:1c5:: with SMTP id x5mr8986904oic.57.1579401507537; Sat, 18 Jan 2020 18:38:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579401507; cv=none; d=google.com; s=arc-20160816; b=h2OV4Y0cr3LLK07uM41oF8wDKQ0coflj+C+j9dR9RJ52kn3peudMmyKRwiSe3zXxH6 F8WiC7jOLbkSm0eQY1ha6KC2Ov1asK0/emZFzlh6b2/QJ9K0QJICDV0WEaQuNJ6M1pEv N5AR9CT/+7Hth/L/0WLk9JflHrYBtCdABpXi7/Hk86G7IjTecPWEYt4WfKxAEs/H7H/2 86o/7hUmvzh8MWTQlHtXYmlGb90zkV9mk5FLhc5KIa3Dp4D7Sl6o5WdPFCOPYxYp4ZSQ AxidRhVOcrtE3aqYkPqwOoSGgx8LTjAQqoYxxZA2qRjAGDmRvxFYf5K00CJnMdlLDk47 VubQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=Q5gr6zNvTTG2nq28EWjn7uwTw2T2Xk8Y0k6ZsdU/Ov0=; b=ket649kqqQVfRyO87Ts9IchTVFVC1s1XFInfX1xP2HY1DpsqOmSMKXAh7yoeZUCr0T 2PIIEFXF/a0J8pzS2mpubMPmXuHCyTCihJXNbF2rL/X9uh6MSW4UiVXRXke7ml1QrcMq IcwY0VSs1dRCYoB4a5KC7CQg9OqRAYJhrZY/QhI46tBbKmBAOhoMxdCaYi8RIIXQIJXD btpDlIgpllQwdPpD7izuqAevIPWd9mv1tCBnDnoyg9hRNIXt1PpuyD5TtCr3rhybN4uY XlMDW+8Fq/Xdf2wwLuU7sYhSivT6ju+wPub/Fgqn8vLMQ4dkdbZYhv+U9+8u7zAtPor6 Iiyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w131si13818941oie.47.2020.01.18.18.38.13; Sat, 18 Jan 2020 18:38:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728708AbgASChM (ORCPT + 99 others); Sat, 18 Jan 2020 21:37:12 -0500 Received: from mga07.intel.com ([134.134.136.100]:38516 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727403AbgASChL (ORCPT ); Sat, 18 Jan 2020 21:37:11 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jan 2020 18:37:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,336,1574150400"; d="scan'208";a="424864862" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga005.fm.intel.com with ESMTP; 18 Jan 2020 18:37:09 -0800 Date: Sun, 19 Jan 2020 10:37:20 +0800 From: Wei Yang To: Yang Shi 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 Message-ID: <20200119023720.GD9745@richard> Reply-To: Wei Yang References: <1579325203-16405-1-git-send-email-yang.shi@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1579325203-16405-1-git-send-email-yang.shi@linux.alibaba.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >Cc: Wei Yang >Cc: [4.17+] >Signed-off-by: Yang Shi >--- > 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