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.5 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 129F1C2D0B1 for ; Fri, 6 Dec 2019 09:45:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B92F22245C for ; Fri, 6 Dec 2019 09:45:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B92F22245C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 159736B1524; Fri, 6 Dec 2019 04:45:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E2F16B1525; Fri, 6 Dec 2019 04:45:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EEE016B1526; Fri, 6 Dec 2019 04:45:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id D4EE36B1524 for ; Fri, 6 Dec 2019 04:45:38 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 79E2C4410 for ; Fri, 6 Dec 2019 09:45:38 +0000 (UTC) X-FDA: 76234234356.25.berry33_4e40169177953 X-HE-Tag: berry33_4e40169177953 X-Filterd-Recvd-Size: 4534 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Fri, 6 Dec 2019 09:45:37 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id c20so5222491wmb.0 for ; Fri, 06 Dec 2019 01:45:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VgZXkaerCaq814dwnILX7vYtRFOjbm5DfD5NkTzjaTo=; b=gXpvbk3tP3SUqd3StHPw/X93/XL8gSF6rypErCdsb/6srCJ29AYSCD8lpK7cYTinAL 4X/FjwAloUAP1ZUDHf7i7O05O5GCEmz44JAPQW5vS8vrUpBg0HnDXuZlKgKpPFjKpO+X rxkPwpXls0t2X6NF0IkBzVvCI6O9Glvyw9hTvFE7+0i2w3vvRItRVV+yxvS/1VrdTew8 6qVK1ts58qYXiqiL0xpdN/LXoAR1HdAWzTz/a9W5gaCADZLXJU5SnXcL8NQlRkIuly0m ucMW2eXcAfeAyUmVW550Mx7+r6xqpchcreE5G49EO4RkS/dlTZEej0WsJIjz4k15VgKA e/lg== X-Gm-Message-State: APjAAAWr8mTAWCjf+fwTAVlLaKV+HWYbuXfTtFI/g9BEfwJ8oDiIT+3k IdZKU3Gc1MG8Sh64CeU/Z8I= X-Google-Smtp-Source: APXvYqxzG3UZEpVj2ra8UPftUD4jNLDT9c/lbi7vIZ4Au8QKO1FCp9GXKuu0+aBLhs5BYLTfzIZ2OA== X-Received: by 2002:a7b:c24c:: with SMTP id b12mr9616831wmj.16.1575625536360; Fri, 06 Dec 2019 01:45:36 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id d186sm2986921wmf.7.2019.12.06.01.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 01:45:35 -0800 (PST) Date: Fri, 6 Dec 2019 10:45:34 +0100 From: Michal Hocko To: John Hubbard Cc: Yang Shi , 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 Subject: Re: [PATCH] move_pages.2: not return ENOENT if the page are already on the target nodes Message-ID: <20191206094534.GL28317@dhcp22.suse.cz> References: <1575596090-115377-1-git-send-email-yang.shi@linux.alibaba.com> <0dc96e40-5f2b-a2fe-6e5f-b6f3d5e9ebde@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0dc96e40-5f2b-a2fe-6e5f-b6f3d5e9ebde@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. Btw. Page states error codes could see some refinements as well. -- Michal Hocko SUSE Labs