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,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 A188DC2BBE2 for ; Fri, 6 Dec 2019 18:20:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8552A24683 for ; Fri, 6 Dec 2019 18:20:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726414AbfLFSUA (ORCPT ); Fri, 6 Dec 2019 13:20:00 -0500 Received: from gentwo.org ([3.19.106.255]:47162 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbfLFSUA (ORCPT ); Fri, 6 Dec 2019 13:20:00 -0500 Received: by gentwo.org (Postfix, from userid 1002) id F0F143EE4A; Fri, 6 Dec 2019 18:19:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id F00093EE48; Fri, 6 Dec 2019 18:19:58 +0000 (UTC) Date: Fri, 6 Dec 2019 18:19:58 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Qian Cai cc: Yang Shi , Michal Hocko , John Hubbard , mtk.manpages@gmail.com, 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 In-Reply-To: Message-ID: References: <5384814f-c937-9622-adbe-c03e199e0267@linux.alibaba.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="531401748-481738838-1575656398=:17787" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --531401748-481738838-1575656398=:17787 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Fri, 6 Dec 2019, Qian Cai wrote: > > On Dec 6, 2019, at 12:31 PM, Yang Shi wrote: > > > > 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. > > I don’t read it on purpose. “There is no point in returning -ENOENT from > sys_move_pages() if all pages were already on the right node”, so this > is only taking about the pages in the desired node. Anyway, but now it > is probably the best time to think outside the box redesigning this > syscalls and nuke this whole mess. The nature of the beast is that moving pages is not a deterministic process. The ability to move depends on pages being pinned and locked by other kernel subsystem. Other system components may also move the page independently. If the user calls this system call and wants to move some pages then he has presumably figured out somehow that pages are misplaced. If no pages can be moved then the system call did nothing which could indicate that some other process is interfering with the desire to move pages to certain nodes. This could be important to know (maybe the other system components already moved the page indepently or another user is also migrating pages). --531401748-481738838-1575656398=:17787-- 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,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 3BC9BC3F68F for ; Fri, 6 Dec 2019 18:20:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0E1E0206DF for ; Fri, 6 Dec 2019 18:20:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E1E0206DF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 94B2B6B1726; Fri, 6 Dec 2019 13:20:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D55A6B1727; Fri, 6 Dec 2019 13:20:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C4B06B1728; Fri, 6 Dec 2019 13:20:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id 630516B1726 for ; Fri, 6 Dec 2019 13:20:00 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 0F6C34DBC for ; Fri, 6 Dec 2019 18:20:00 +0000 (UTC) X-FDA: 76235530560.27.watch13_3a2c4a40b7f26 X-HE-Tag: watch13_3a2c4a40b7f26 X-Filterd-Recvd-Size: 3098 Received: from gentwo.org (gentwo.org [3.19.106.255]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Fri, 6 Dec 2019 18:19:59 +0000 (UTC) Received: by gentwo.org (Postfix, from userid 1002) id F0F143EE4A; Fri, 6 Dec 2019 18:19:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id F00093EE48; Fri, 6 Dec 2019 18:19:58 +0000 (UTC) Date: Fri, 6 Dec 2019 18:19:58 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Qian Cai cc: Yang Shi , Michal Hocko , John Hubbard , mtk.manpages@gmail.com, 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 In-Reply-To: Message-ID: References: <5384814f-c937-9622-adbe-c03e199e0267@linux.alibaba.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="531401748-481738838-1575656398=:17787" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000408, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --531401748-481738838-1575656398=:17787 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, 6 Dec 2019, Qian Cai wrote: > > On Dec 6, 2019, at 12:31 PM, Yang Shi wr= ote: > > > > It looks since commit e78bbfa82624 ("mm: stop returning -ENOENT from = sys_move_pages() if nothing got migrated") too, which reset err to 0 unco= nditionally. It seems it is on purpose by that commit the syscall caller = should check status for the details according to the commit log. > > I don=E2=80=99t read it on purpose. =E2=80=9CThere is no point in retur= ning -ENOENT from > sys_move_pages() if all pages were already on the right node=E2=80=9D, = so this > is only taking about the pages in the desired node. Anyway, but now it > is probably the best time to think outside the box redesigning this > syscalls and nuke this whole mess. The nature of the beast is that moving pages is not a deterministic process. The ability to move depends on pages being pinned and locked by other kernel subsystem. Other system components may also move the page independently. If the user calls this system call and wants to move some pages then he has presumably figured out somehow that pages are misplaced. If no pages can be moved then the system call did nothing which could indicate that some other process is interfering with the desire to move pages to certai= n nodes. This could be important to know (maybe the other system components alread= y moved the page indepently or another user is also migrating pages). --531401748-481738838-1575656398=:17787--