Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1046406ybl; Fri, 6 Dec 2019 10:20:59 -0800 (PST) X-Google-Smtp-Source: APXvYqx+wynteiZSEKPBIc9Qis6gzpBTCIESlbvIX6FQ11wRBlMtc7GtqE1K/8ZSTF6a0cTi5OQI X-Received: by 2002:a05:6808:98b:: with SMTP id a11mr13762731oic.62.1575656459861; Fri, 06 Dec 2019 10:20:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575656459; cv=none; d=google.com; s=arc-20160816; b=k41F7tkpXj0DTIxoTX1QybUqW3CNU6AHzc/HPWZyFBJxEvK612mb2Zf8MhmX3qJExq KYUx4VtbydutSgH76jl+VflVsC1oeZmOSKjfwDet1TgIIt9GXesji8E2xM3IRnfgniy0 ZS/I2ZAXMAiqI62XKqVBimcvi2nYjk264PYtNUPeoBzuZjHYV2gLFSQc+dItXfwbrpZw 243lBmIt1h6tVzPz9QmIoIoh35ms/xBXYDePD6v9Db4dw7dj7a7pzVOBVHGMb5PfOlBO TKDj+VlefRije5EXJYnRVqtMZBKU/m7gXG87J0tuRF3j2ctbrmzW1IEoDsCO0WHLZhxB auCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=g5xNyytepOo//FsIvArPWful0MgU9ngjkUiMKc3QHnQ=; b=eR3Qg0f8XfyO6GrOIZxi5X/g7CJ5ryJ0POhQlB5KzpBl3sAZV4wTCgGKA5rhwn9a1y J7t0zZYlE2quInjCEsUmpiWQhofzoKOE3f2kIXGPh1rdmnlOjHl70NKcc1ckG1mDIPoG skfY5N4vmWmVfi1sUd4VgE/WIo2AVAKd1YsU8VNFVYQ1AkfxDY3DwHL8xOtBPuTy8snU P3n2nMJ2sb62gCpDQ/swH7juLsboi5H1o7is0pQhael0wk04Y6W7V1b5NuLAkROJcL7K We73wDmQLx+ELRRZA+12ts0YtZfPQ/MDNK7DQ306DI4LyAdbG6dHM9zHX4bDME+Agzd1 9y/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y198si7729714oia.163.2019.12.06.10.20.47; Fri, 06 Dec 2019 10:20:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726404AbfLFSUA (ORCPT + 99 others); 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--