From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94B61C43603 for ; Fri, 6 Dec 2019 17:31:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 669162245C for ; Fri, 6 Dec 2019 17:31:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 669162245C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E29F26B16F1; Fri, 6 Dec 2019 12:31:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DDB476B16F8; Fri, 6 Dec 2019 12:31:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF1516B16F9; Fri, 6 Dec 2019 12:31:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0223.hostedemail.com [216.40.44.223]) by kanga.kvack.org (Postfix) with ESMTP id B96306B16F1 for ; Fri, 6 Dec 2019 12:31:45 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 642BC828F656 for ; Fri, 6 Dec 2019 17:31:45 +0000 (UTC) X-FDA: 76235408970.06.mask88_496513ae7973e X-HE-Tag: mask88_496513ae7973e X-Filterd-Recvd-Size: 3941 Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Fri, 6 Dec 2019 17:31:43 +0000 (UTC) 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.