Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp997112ybl; Fri, 6 Dec 2019 09:32:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxKx89A+aP6/PuFJuCp6irRyd+vbi2R7UTwFdz3RMpOfO5MpwqYLl/ZQ56kEs41zgr0eHa6 X-Received: by 2002:a05:6808:b26:: with SMTP id t6mr12412358oij.123.1575653545682; Fri, 06 Dec 2019 09:32:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575653545; cv=none; d=google.com; s=arc-20160816; b=M0CurwjiG3LfMUZ+ixw+R5z2gdzeX9uaKfVbsiFyFo4lpcOMlFC9MfNA6tLK1hXZJz aYjuxd/UFh1CV8TL0uSuyoM4bxy6ocejSXjovOeHZc3nnQXzoWkWGsMwynnT48o2I7TT AmDoJyw7J2QOlzMjj7tF4ImMJvEIYXBb0eIVCoBLQjiJ2HRFGLgDUgZTKrQ2qMQHzK9J e3tqJBavqO9lMAVBut3+BZ6fJDPKbh5jDMJDz0PZyCvA0ws21IZREdUJrCXpQuCTId3w JrtsfhMpF4H0UcccgkiSHAGFPOPwNUCt1uPLCfBUZhmZVPIPx8PpXFXB5DxhdD/Mn2nF MlQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=lc1kXlGr62td4LxYCJQPJdymx86dOJMoEE6L+d5uLls=; b=lzDaMGxgH93AL8S0kC7jZDmvPG+NfTT9zTjndrFcyG/O/+IDK6WrNJj/DphzXvCsuJ jezEOI+akyyFgMwI4q44tszFxUioTGJfTPPON2b5MdHlgF8PngEIizt5qBsMCPficGsq HRWlbq4liD/KV2/M7UJjtfvS/bYBeypYYOC2KgYBIPS1f1Dj9b1EfCFxx1bNKYDkpdNS 1ne/NkN1IrJKMTMCqry8V+gCLc5kSQ71jiFf0YL1pLpgVgzch/7G2NleRixbmYqQ9ArE JeeYX6nSFZ5gOSpQs4UVNqnEACQvc8UHPMktjE9NNhzecbgTM5P8kkEsLrlh5+YVzDYZ M0xQ== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si7359888otq.41.2019.12.06.09.32.12; Fri, 06 Dec 2019 09:32:25 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726332AbfLFRbk (ORCPT + 99 others); Fri, 6 Dec 2019 12:31:40 -0500 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:36359 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbfLFRbk (ORCPT ); Fri, 6 Dec 2019 12:31:40 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R621e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0Tk8UvMe_1575653494; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0Tk8UvMe_1575653494) by smtp.aliyun-inc.com(127.0.0.1); Sat, 07 Dec 2019 01:31:38 +0800 Subject: Re: [PATCH] move_pages.2: not return ENOENT if the page are already on the target nodes To: Michal Hocko , John Hubbard Cc: mtk.manpages@gmail.com, cl@linux.com, cai@lca.pw, akpm@linux-foundation.org, linux-man@vger.kernel.org, linux-api@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1575596090-115377-1-git-send-email-yang.shi@linux.alibaba.com> <0dc96e40-5f2b-a2fe-6e5f-b6f3d5e9ebde@nvidia.com> <20191206094534.GL28317@dhcp22.suse.cz> From: Yang Shi Message-ID: <5384814f-c937-9622-adbe-c03e199e0267@linux.alibaba.com> Date: Fri, 6 Dec 2019 09:31:31 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20191206094534.GL28317@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/6/19 1:45 AM, Michal Hocko wrote: > On Fri 06-12-19 00:25:53, John Hubbard wrote: >> On 12/5/19 5:34 PM, Yang Shi wrote: >>> Since commit e78bbfa82624 ("mm: stop returning -ENOENT >>> from sys_move_pages() if nothing got migrated"), move_pages doesn't >>> return -ENOENT anymore if the pages are already on the target nodes, but >>> this change is never reflected in manpage. >>> >>> Cc: Michael Kerrisk >>> Cc: Christoph Lameter >>> Cc: John Hubbard >>> Cc: Michal Hocko >>> Cc: Qian Cai >>> Signed-off-by: Yang Shi >>> --- >>> man2/move_pages.2 | 5 ++--- >>> 1 file changed, 2 insertions(+), 3 deletions(-) >>> >>> diff --git a/man2/move_pages.2 b/man2/move_pages.2 >>> index 2d96468..2a2f3cd 100644 >>> --- a/man2/move_pages.2 >>> +++ b/man2/move_pages.2 >>> @@ -192,9 +192,8 @@ was specified or an attempt was made to migrate pages of a kernel thread. >>> One of the target nodes is not online. >>> .TP >>> .B ENOENT >>> -No pages were found that require moving. >>> -All pages are either already >>> -on the target node, not present, had an invalid address or could not be >>> +No pages were found. >>> +All pages are either not present, had an invalid address or could not be >>> moved because they were mapped by multiple processes. >>> .TP >>> .B EPERM >>> >> whoa, hold on. If I'm reading through the various error paths correctly, then this >> code is *never* going to return ENOENT for the whole function. It can fill in that >> value per-page, in the status array, but that's all. Did I get that right? > You are right. Both store_status and do_move_pages_to_node do overwrite > the error code. So you are right that ENOENT return value is not > possible. I haven't checked since when this is the case. This whole > syscall is a disaster from the API and documentation POV. It looks since commit e78bbfa82624 ("mm: stop returning -ENOENT from sys_move_pages() if nothing got migrated") too, which reset err to 0 unconditionally. It seems it is on purpose by that commit the syscall caller should check status for the details according to the commit log. > > Btw. Page states error codes could see some refinements as well.