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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 D6D1BC18E7A for ; Tue, 10 Mar 2020 18:24:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 89CBC20727 for ; Tue, 10 Mar 2020 18:24:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y4Mv/RG7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89CBC20727 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 403E46B0005; Tue, 10 Mar 2020 14:24:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3B42B6B0006; Tue, 10 Mar 2020 14:24:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C9396B0007; Tue, 10 Mar 2020 14:24:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0179.hostedemail.com [216.40.44.179]) by kanga.kvack.org (Postfix) with ESMTP id 156A66B0005 for ; Tue, 10 Mar 2020 14:24:40 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B0DAA180AD81F for ; Tue, 10 Mar 2020 18:24:39 +0000 (UTC) X-FDA: 76580278278.04.brake86_629ed9262b848 X-HE-Tag: brake86_629ed9262b848 X-Filterd-Recvd-Size: 6477 Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Mar 2020 18:24:37 +0000 (UTC) Received: by mail-ed1-f65.google.com with SMTP id a13so17522007edu.7 for ; Tue, 10 Mar 2020 11:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=N/geXS1ktRmdQ+oZIMa1IAHtn3QcVn0X1vL0uiDn3J4=; b=Y4Mv/RG7zokLOwUODFO2Sv/EsmnAk1VZ6R2I1es12dgvA3dk4X/FWJFZtNRWBjxX1c tVE1ZflhW3Kp4bjtPKBmvvGeMQBcsZJGTmkv7NDsC+94yefejDo+krJ0mZ6z+rCw29Im w5SvEhrJQa6CY2pe6OGXV9OZku2qIrPt4tm7ZbL1pJBuSrlEpdEFvJnaweYP7JX7wsu6 3EBT1W+V8D13FVYcMyWH69qIrnuH7bI3DBm1p+PPNdmJhjYQ4GyexONkrlvMCfGAsbbb 1WD62Oo0SFgxKGpMJph4XgLJKb+hluMBN5swYQF3UNmoZ6eQ1R28PSpsdXiZMQLAQm6s /hbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=N/geXS1ktRmdQ+oZIMa1IAHtn3QcVn0X1vL0uiDn3J4=; b=sh5rqGAb9fOZA/wSsUFhRR4a1ODR22Eu72e7E7U5qDMxNXJRKMzccHGIeRusjAMh8l 0GwiFxSC/2r+urZUKonqwD8S3Jv8BOKvdzDzO0ElUfQRkGI2om+ZUrUaEcDw3MnWvDkK AJ8TpL1pP6Bcu5/6cvMv4PBh2wIZDJiZnk42yBovgsNp/OY6U3Vvi8rREXjWrSkYW/+/ 0RcaGN/XF0yggP70mekGoPrESP2pnA3GVfoyjNXlncnxyMKHk9IU9NeC1H6FkIQGjcFy 7kGdXG4YapoBoD/mWG1LEEndpSsHqwou9X/Ad7BjqJKXPo6Vs8MhT/pp+GZOfOkxtIaO lkRw== X-Gm-Message-State: ANhLgQ3v+DMQ5dyU3kuc8gOWurZLPzVXbWvM2SXVtAUwizWWaej/Z9bC glvHeXrdN/1DFrdT96GEC5OQEWv8RqLblGMBlNw= X-Google-Smtp-Source: ADFU+vs6jC86jhNiQ9dqBIBIQR+hMKRBT5ajUKABb3eFRrfB1usVWKKbkTyQo55pqkLEuvp3Hn5ZneyFnY3BCe2a92I= X-Received: by 2002:a17:906:3e0c:: with SMTP id k12mr5881975eji.309.1583864674852; Tue, 10 Mar 2020 11:24:34 -0700 (PDT) MIME-Version: 1.0 References: <1580757507-120233-1-git-send-email-yang.shi@linux.alibaba.com> <20200210093635.GC10636@dhcp22.suse.cz> <92f30e24-7b77-b21a-ed3a-efc55bc500c6@linux.alibaba.com> In-Reply-To: <92f30e24-7b77-b21a-ed3a-efc55bc500c6@linux.alibaba.com> From: Yang Shi Date: Tue, 10 Mar 2020 11:24:21 -0700 Message-ID: Subject: Re: [v3 PATCH] move_pages.2: Returning positive value is a new error case To: mtk.manpages@gmail.com Cc: Yang Shi , Michal Hocko , david@redhat.com, Andrew Morton , linux-man@vger.kernel.org, linux-api@vger.kernel.org, Linux MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" 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 Thu, Feb 20, 2020 at 9:07 AM Yang Shi wrote: > > > > On 2/10/20 1:36 AM, Michal Hocko wrote: > > On Tue 04-02-20 03:18:27, Yang Shi wrote: > >> Since commit a49bd4d71637 ("mm, numa: rework do_pages_move"), > >> the semantic of move_pages() has changed to return the number of > >> non-migrated pages if they were result of a non-fatal reasons (usually a > >> busy page). This was an unintentional change that hasn't been noticed > >> except for LTP tests which checked for the documented behavior. > >> > >> There are two ways to go around this change. We can even get back to the > >> original behavior and return -EAGAIN whenever migrate_pages is not able > >> to migrate pages due to non-fatal reasons. Another option would be to > >> simply continue with the changed semantic and extend move_pages > >> documentation to clarify that -errno is returned on an invalid input or > >> when migration simply cannot succeed (e.g. -ENOMEM, -EBUSY) or the > >> number of pages that couldn't have been migrated due to ephemeral > >> reasons (e.g. page is pinned or locked for other reasons). > >> > >> We decided to keep the second option in kernel because this behavior is in > >> place for some time without anybody complaining and possibly new users > >> depending on it. Also it allows to have a slightly easier error handling > >> as the caller knows that it is worth to retry when err > 0. > >> > >> Update man pages to reflect the new semantic. > >> > >> Cc: Michal Hocko > >> Cc: Michael Kerrisk > >> Signed-off-by: Yang Shi > Hi Michale, Maybe my work email went to your spam folder. So, ping with my personal email. Would you please consider take this patch? Thanks, Yang > Hi Michael, > > Would you please consider take this patch? The kernel change has been > upstreamed. > > Thanks, > Yang > > > Acked-by: Michal Hocko > > > >> --- > >> v3: * Fixed the comments from David Hildenbrand. > >> * Fixed the inaccuracy about pre-initialized status array values. > >> v2: * Added notes about status array per Michal. > >> * Added Michal's Acked-by. > >> > >> man2/move_pages.2 | 10 ++++++++-- > >> 1 file changed, 8 insertions(+), 2 deletions(-) > >> > >> diff --git a/man2/move_pages.2 b/man2/move_pages.2 > >> index 1bf1053..50c83a4 100644 > >> --- a/man2/move_pages.2 > >> +++ b/man2/move_pages.2 > >> @@ -104,7 +104,9 @@ pages that need to be moved. > >> is an array of integers that return the status of each page. > >> The array contains valid values only if > >> .BR move_pages () > >> -did not return an error. > >> +did not return an error. Pre-initialization of the array to the value > >> +which cannot represent a real numa node or valid error of status array > >> +could help to identify pages that have been migrated > >> .PP > >> .I flags > >> specify what types of pages to move. > >> @@ -164,9 +166,13 @@ returns zero. > >> .\" do the right thing? > >> On error, it returns \-1, and sets > >> .I errno > >> -to indicate the error. > >> +to indicate the error. If positive value is returned, it is the number of > >> +non-migrated pages. > >> .SH ERRORS > >> .TP > >> +.B Positive value > >> +The number of non-migrated pages if they were the result of non-fatal > >> +reasons (since version 4.17). > >> .B E2BIG > >> Too many pages to move. > >> Since Linux 2.6.29, > >> -- > >> 1.8.3.1 >