Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4033933ybl; Tue, 21 Jan 2020 11:34:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxMKozjvltzDzQrP2HWTVxb/iooN4pLTRZcuA+u5mdjCMEZmP+ppP6hw3v6onlUFSbuAcOf X-Received: by 2002:a05:6808:c:: with SMTP id u12mr4257456oic.107.1579635272800; Tue, 21 Jan 2020 11:34:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579635272; cv=none; d=google.com; s=arc-20160816; b=XJCzbs8NW3MWiRhP7n4iy8wVyWlx7xjfasm9e1z9jJTu/K+55yh0GoPcbZqU6pClkA bQG3Mg1cgsQEqMsBrobDZJiyhi5hnMHMCgdMQ/kpj+hLQTbT1M8bi07ukVN00qgwElqr 76CKb4xvi82PzGsDl9jSu18/3zc1JrUIZVSINCgjF4+hJpXOarGNMpMulo0eoCnDYhoQ zd+4bvuyOL0dfa5uMNurhymhJcenCcbKscvldSHtJyjPo9S46T0psxNKRlGK8JL+EsEs Kv2t3xB97BJdE6Sj0N+P5h4Tjw6OUoGO7GfVa3LfbzDn9J07RszA9KJB+Fi85FFf2f4V QGIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=LlAW74O5W3Hcc7t1Zx9fPiJAiXGsAliik4al1DRvKWo=; b=JbNtx4hnOGvWujnNhoutFY3uueLdBzM+c2A2cYzLAnPs7tJey2vWt5xk8EIy+waShu +UnNllebRSw9AiFrqIoqHkZro+e2WWW/nZFeUEp6rGiJabndGHULTzFXszduWZDfIUlK s7WBhsjSky4vW6nlqanTXXMJwDW324oaHiUY/pYnME2zdMSMomQm0zm2ceCvzqWsBDIq KBmB1zOvuKR4McX7G1OfmghGtY6qXNdGEbAxoW60wI0MN7OArd1RsMA0iuvnqJYwiX7Y rYyLUulqeZZZNchSS0YhGeMyZqD+J1dqsxNZcGu+qaJUKvLP4gzwAnLYaIOfMPcQ/gzJ AEbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=hOZjWF1x; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i78si20180089oib.1.2020.01.21.11.34.19; Tue, 21 Jan 2020 11:34:32 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=hOZjWF1x; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727829AbgAUTdS (ORCPT + 99 others); Tue, 21 Jan 2020 14:33:18 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:5547 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbgAUTdS (ORCPT ); Tue, 21 Jan 2020 14:33:18 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 21 Jan 2020 11:33:01 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Tue, 21 Jan 2020 11:33:16 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Tue, 21 Jan 2020 11:33:16 -0800 Received: from MacBook-Pro-10.local (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 21 Jan 2020 19:33:16 +0000 Subject: Re: [Patch v2] mm/migrate.c: also overwrite error when it is bigger than zero To: Wei Yang CC: , , , , , , References: <20200119065753.21694-1-richardw.yang@linux.intel.com> <20200121015326.GE1567@richard> <20200121023408.GA3636@richard> From: John Hubbard X-Nvconfidentiality: public Message-ID: <0aa42c19-4144-5c7a-10f5-162b1b068d4c@nvidia.com> Date: Tue, 21 Jan 2020 11:33:16 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200121023408.GA3636@richard> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1579635181; bh=LlAW74O5W3Hcc7t1Zx9fPiJAiXGsAliik4al1DRvKWo=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=hOZjWF1xebzIxPRh61QJ4Uv2JFRLLy8p5EkTbciG1ao9gwKv9A2vXDw2zaQsQD22Q guSwUN3mdbi887uA33aUsXHa0TzFtr4lxvvLb8g5vW2+VNF7cKHe5rpMmZeFMHZVw/ dml0iWlyV0DSx5jd67h6Je2vGXcKD13WWM+63zPOmYVPRRiki0CVhVb9IVNz8eiVFi gH9NUT8P/Q0Fsv/6ikCCrrH20A4AABP4Vcg20YgtzVssMdErt1W/EVxp2n/4wYbUx/ n+BQXNdjoY+QS3Ni7c12gGMLacOY36g/FEC7C38qIVeRRkm9EMc4rvPJq+Zf/7kC4b d43VMQzv9cgMA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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