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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=no 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 EA515C43603 for ; Thu, 5 Dec 2019 19:27:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6096F206D9 for ; Thu, 5 Dec 2019 19:27:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6096F206D9 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 0CF906B11CC; Thu, 5 Dec 2019 14:27:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 07F506B11CD; Thu, 5 Dec 2019 14:27:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED6E56B11CE; Thu, 5 Dec 2019 14:27:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D83E46B11CC for ; Thu, 5 Dec 2019 14:27:37 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 7CD2433C4 for ; Thu, 5 Dec 2019 19:27:37 +0000 (UTC) X-FDA: 76232072154.11.lamp77_83efdddd1405 X-HE-Tag: lamp77_83efdddd1405 X-Filterd-Recvd-Size: 3093 Received: from out30-54.freemail.mail.aliyun.com (out30-54.freemail.mail.aliyun.com [115.124.30.54]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Thu, 5 Dec 2019 19:27:36 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07487;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0Tk3hI4V_1575574049; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0Tk3hI4V_1575574049) by smtp.aliyun-inc.com(127.0.0.1); Fri, 06 Dec 2019 03:27:33 +0800 Subject: Re: [v3 PATCH] mm: move_pages: return valid node id in status if the page is already on the target node To: Qian Cai Cc: fabecassis@nvidia.com, jhubbard@nvidia.com, mhocko@suse.com, cl@linux.com, vbabka@suse.cz, mgorman@techsingularity.net, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <1575572053-128363-1-git-send-email-yang.shi@linux.alibaba.com> <0E1D1C04-5892-438F-9191-F23CBE1A6DC5@lca.pw> From: Yang Shi Message-ID: Date: Thu, 5 Dec 2019 11:27:27 -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: <0E1D1C04-5892-438F-9191-F23CBE1A6DC5@lca.pw> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.003579, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 12/5/19 11:19 AM, Qian Cai wrote: > >> On Dec 5, 2019, at 1:54 PM, Yang Shi wrot= e: >> >> This is because the status is not set if the page is already on the >> target node, but move_pages() should return valid status as long as it >> succeeds. The valid status may be errno or node id. >> >> We can't simply initialize status array to zero since the pages may be >> not on node 0. Fix it by updating status with node id which the page = is >> already on. > This does not look correct either. > > =E2=80=9CENOENT > No pages were found that require moving. All pages are either already o= n the target node, not present, had an invalid address or could not be mo= ved because they were mapped by multiple processes.=E2=80=9D > > move_pages() should return -ENOENT instead. Yes, we noticed this too. I had a note in v1 and v2 patch, but I forgot=20 paste in v3, says: John noticed another return value inconsistency between the=20 implementation and the manpage. The manpage says it should return=20 -ENOENT if the page is already on the target node, but it doesn't. It=20 looks the original code didn't return -ENOENT either, I'm not sure if=20 this is a document issue or not. Anyway this is another issue, once we=20 confirm it we can fix it later. And, Michal also commented to the note: I do not remember all the details but my recollection is that there were=20 several inconsistencies present before I touched the code and I've=20 decided to not touch them without a clear usecase.