Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4275705ybl; Tue, 21 Jan 2020 16:44:19 -0800 (PST) X-Google-Smtp-Source: APXvYqxzTYrQ5JXEK9vYlWDCYr6xBQ8z7ICe6Ovx6cN/2hdTnbWwKR9WlaAY85efN7TYX73jGB1i X-Received: by 2002:aca:b608:: with SMTP id g8mr5144770oif.142.1579653858978; Tue, 21 Jan 2020 16:44:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579653858; cv=none; d=google.com; s=arc-20160816; b=0B3WS/mB2x1wTzmYoG76wnEyOz52mNxP865cZAxna29d4YRYVAIjShuDLsIeetrGZc istLsWyf3g/lieyoH9QCt7BiV0fmtx+PaTjvOEzVpIzIK5US9qUzsUABzh59FWhdWJYu Zh9+cfty1qYsGxuyNlMqZ6dMEIKQU0sEK2psGhIlM/gSaRz5L1r8wxFEdobpbmQNXUiA kF/nJtDxD+Wx2MS6Iq4XOEv2wS+qADpw386UG/VxCScTH62vzlwnCFN938Okn5timTHu eiOyaN9owc8PoDzS05VxBJVad7x8hpUC667OXq8LajU4HpiOm0Wd9JTNoKV9mYeIgvyV ObMA== 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=gFjOwdsZTaEZ7xWAMS1hFCaRETG13QnD9TOUvv5oNkA=; b=utZFsqtaUkBgz2jDJxtF8/zwv7OGd2I8w/woBTGOW94r9EC/SHtzZ0wGkOBXzDHCrm fkLSGleMelm7hlDJM1ywGMgDJW3lPPVL6zeCiEhF3ydXAmoqUnLoXRX7PTLzjB6QkTUK z+UmTriifYqCIE0ISePoQtwaCp2ZuS9anRPBEpPofC+BZyE032jtFWbRpN+UsZCTphFw Ho1104V+R7617zSzFUIK9Air3CkV0wTTRkXkVdASgKYBTNeEvBGUWkEj61n/hpHfHEcI rtM5kBvFrT91roS5ymSovkoqXCS+Regujmvo0/V3DSuCwQ1Tw/3UW0zenZON/McXNOY2 KpWA== 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 x3si20346872oie.146.2020.01.21.16.44.06; Tue, 21 Jan 2020 16:44:18 -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 S1728899AbgAVAm6 (ORCPT + 99 others); Tue, 21 Jan 2020 19:42:58 -0500 Received: from mga06.intel.com ([134.134.136.31]:22832 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727969AbgAVAm5 (ORCPT ); Tue, 21 Jan 2020 19:42:57 -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 orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jan 2020 16:42:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,347,1574150400"; d="scan'208";a="425679164" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga005.fm.intel.com with ESMTP; 21 Jan 2020 16:42:11 -0800 Date: Wed, 22 Jan 2020 08:42:22 +0800 From: Wei Yang To: John Hubbard Cc: Wei Yang , akpm@linux-foundation.org, yang.shi@linux.alibaba.com, vbabka@suse.cz, cl@linux.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, mhocko@kernel.org Subject: Re: [Patch v2] mm/migrate.c: also overwrite error when it is bigger than zero Message-ID: <20200122004222.GD11409@richard> Reply-To: Wei Yang References: <20200119065753.21694-1-richardw.yang@linux.intel.com> <20200121015326.GE1567@richard> <20200121023408.GA3636@richard> <0aa42c19-4144-5c7a-10f5-162b1b068d4c@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0aa42c19-4144-5c7a-10f5-162b1b068d4c@nvidia.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 Tue, Jan 21, 2020 at 11:33:16AM -0800, John Hubbard wrote: >On 1/20/20 6:34 PM, Wei Yang wrote: >> On Tue, Jan 21, 2020 at 09:53:26AM +0800, Wei Yang wrote: >> > On Sun, Jan 19, 2020 at 02:57:53PM +0800, Wei Yang wrote: >> > > If we get here after successfully adding page to list, err would be >> > > 1 to indicate the page is queued in the list. >> > > >> > > Current code has two problems: >> > > >> > > * on success, 0 is not returned >> > > * on error, if add_page_for_migratioin() return 1, and the following err1 >> > > from do_move_pages_to_node() is set, the err1 is not returned since err >> > > is 1 >> > > >> > > And these behaviors break the user interface. >> > > >> > > Fixes: e0153fc2c760 ("mm: move_pages: return valid node id in status if the >> > > page is already on the target node"). > >The Fixes tag should be different, right? Because I don't think that >commit introduced this problem. This is the correct one. Before this, we don't return 1 from add_page_for_migration(). > >thanks, >-- >John Hubbard >NVIDIA > >> > > Signed-off-by: Wei Yang >> > > >> > > --- >> > > v2: >> > > * put more words to explain the error case >> > > --- >> > > mm/migrate.c | 2 +- >> > > 1 file changed, 1 insertion(+), 1 deletion(-) >> > > >> > > diff --git a/mm/migrate.c b/mm/migrate.c >> > > index 86873b6f38a7..430fdccc733e 100644 >> > > --- a/mm/migrate.c >> > > +++ b/mm/migrate.c >> > > @@ -1676,7 +1676,7 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, >> > > err1 = do_move_pages_to_node(mm, &pagelist, current_node); >> > > if (!err1) >> > > err1 = store_status(status, start, current_node, i - start); >> > > - if (!err) >> > > + if (err >= 0) >> > > err = err1; >> > >> > Ok, as mentioned by Yang and Michal, only err == 0 means no error. >> > >> > Sounds this regression should be fixed in another place. Let me send out >> > another patch. >> > >> >> Hmm... I took another look into the case, this fix should work. >> >> But yes, the semantic here is a little confusion. Look forward your comments >> here. >> >> > > out: >> > > return err; >> > > -- >> > > 2.17.1 >> > >> > -- >> > Wei Yang >> > Help you, Help me >> > >thanks, >-- >John Hubbard >NVIDIA -- Wei Yang Help you, Help me