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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BADDFC7EE39 for ; Mon, 30 Jun 2025 00:58:17 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4bVnpJ2D7dz2yft; Mon, 30 Jun 2025 10:58:16 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=115.124.30.113 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1751245096; cv=none; b=aCkcsnGOPzE9oTdcK3+D0NW7S2a7kyPEJdYC1th3CSwHJ2LwbMMEBFe1PCURof+WsJFx7f50XTu2m5PgOCgPyzMdVjYgl9BtRPghcPm7g5ag8Imtg7t8ONqEev9CE02jxmJgAf+XBfldqbMNDSnRbStpzOCHjKIBR3OpvA0+CceA6pyNxdjd8EIeAn1kYYNh/U4PrO2Q1k/xA7quSQ7HMFTlG3bby65+MtkqZhH5G6UQJtIwDzXjKXX0dwhPeC6bx02Fg/OoJqkmGyMr60lMSExVNm7BIUxvu9aHKTBarUxQFRKnTHslTJBN2Oo3JmR19G7W7ScT2M9wuv9e+tPp8A== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1751245096; c=relaxed/relaxed; bh=KE5Ke26crJ20g62CV0eTsdMDqmR58zlWRKiqOi/7eNA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=bZlTl8aY1tu+7uYVqB3PEOw49QX0BNQaH+1agdjg+RjkTewfbvLC/38LKRwDF/CoR/Z0b020N3GWwGI5I/0PGhOV5Q8wl/DTRxSeO9kBSu+OQNk3IiBrjmUlvpt1evpT4PGAU0Mgi2pz5kpVuxcNyhNt+bh9KJu551bp43jYopY0A0mBEJ76JwOB4PdGnUz8IJlynV2F6X1bXZ28YI3+z1Ds5AU48qLNEb5rJcbGqQlEPkOCJHUy0Z2R6q4pcy8IGmGpRppqQT8xEMG097A+cQ3xyqy4bof3AWMTxGwak0xUMaLlxBeRO90LAiE8FSmod02yEjpAwauq3EqfuzQ2HA== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=JsOjj3LY; dkim-atps=neutral; spf=pass (client-ip=115.124.30.113; helo=out30-113.freemail.mail.aliyun.com; envelope-from=ying.huang@linux.alibaba.com; receiver=lists.ozlabs.org) smtp.mailfrom=linux.alibaba.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=JsOjj3LY; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.113; helo=out30-113.freemail.mail.aliyun.com; envelope-from=ying.huang@linux.alibaba.com; receiver=lists.ozlabs.org) Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4bVnpG184Jz2ydj for ; Mon, 30 Jun 2025 10:58:12 +1000 (AEST) DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1751245088; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=KE5Ke26crJ20g62CV0eTsdMDqmR58zlWRKiqOi/7eNA=; b=JsOjj3LYAE/2bD8rhcWjCHpgvFs8SF2+iSPiyKRiZMX4yYw57ND0HRo17ezy1J7U17SihYB3QNbMaF1IaXqWHih3K2OlF5ffgB1jpzudQs6jpzxUufyTmi/Q7MwYzgtIXKa8QMqEr7FgVq/xZ60CRvs/OxzAYAikw3KX9gfGkzQ= Received: from DESKTOP-5N7EMDA(mailfrom:ying.huang@linux.alibaba.com fp:SMTPD_---0Wg25R9f_1751245082 cluster:ay36) by smtp.aliyun-inc.com; Mon, 30 Jun 2025 08:58:04 +0800 From: "Huang, Ying" To: Alistair Popple Cc: David Hildenbrand , Zi Yan , Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, virtualization@lists.linux.dev, linux-fsdevel@vger.kernel.org, Andrew Morton , Jonathan Corbet , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Jerrin Shaji George , Arnd Bergmann , Greg Kroah-Hartman , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Eugenio =?utf-8?Q?P=C3=A9rez?= , Alexander Viro , Christian Brauner , Jan Kara , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Gregory Price , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Minchan Kim , Sergey Senozhatsky , Brendan Jackman , Johannes Weiner , Jason Gunthorpe , John Hubbard , Peter Xu , Xu Xin , Chengming Zhou , Miaohe Lin , Naoya Horiguchi , Oscar Salvador , Rik van Riel , Harry Yoo , Qi Zheng , Shakeel Butt Subject: Re: [PATCH RFC 07/29] mm/migrate: rename isolate_movable_page() to isolate_movable_ops_page() In-Reply-To: (Alistair Popple's message of "Mon, 30 Jun 2025 10:20:56 +1000") References: <20250618174014.1168640-1-david@redhat.com> <20250618174014.1168640-8-david@redhat.com> <9F76592E-BB0E-4136-BDBA-195CC6FF3B03@nvidia.com> <4D6D7321-CAEC-4D82-9354-4B9786C4D05E@nvidia.com> <87h5zyrdl9.fsf@DESKTOP-5N7EMDA> Date: Mon, 30 Jun 2025 08:58:03 +0800 Message-ID: <878qlaqc4k.fsf@DESKTOP-5N7EMDA> User-Agent: Gnus/5.13 (Gnus v5.13) X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Alistair Popple writes: > On Sun, Jun 29, 2025 at 07:28:50PM +0800, Huang, Ying wrote: >> David Hildenbrand writes: >> >> > On 18.06.25 20:48, Zi Yan wrote: >> >> On 18 Jun 2025, at 14:39, Matthew Wilcox wrote: >> >> >> >>> On Wed, Jun 18, 2025 at 02:14:15PM -0400, Zi Yan wrote: >> >>>> On 18 Jun 2025, at 13:39, David Hildenbrand wrote: >> >>>> >> >>>>> ... and start moving back to per-page things that will absolutely not be >> >>>>> folio things in the future. Add documentation and a comment that the >> >>>>> remaining folio stuff (lock, refcount) will have to be reworked as well. >> >>>>> >> >>>>> While at it, convert the VM_BUG_ON() into a WARN_ON_ONCE() and handle >> >>>>> it gracefully (relevant with further changes), and convert a >> >>>>> WARN_ON_ONCE() into a VM_WARN_ON_ONCE_PAGE(). >> >>>> >> >>>> The reason is that there is no upstream code, which use movable_ops for >> >>>> folios? Is there any fundamental reason preventing movable_ops from >> >>>> being used on folios? >> >>> >> >>> folios either belong to a filesystem or they are anonymous memory, and >> >>> so either the filesystem knows how to migrate them (through its a_ops) >> >>> or the migration code knows how to handle anon folios directly. >> > >> > Right, migration of folios will be handled by migration core. >> > >> >> for device private pages, to support migrating >0 order anon or fs >> >> folios >> >> to device, how should we represent them for devices? if you think folio is >> >> only for anon and fs. >> > >> > I assume they are proper folios, so yes. Just like they are handled >> > today (-> folios) > > Yes, they should be proper folios. So, folios include file cache, anonymous, and some device private. >> > I was asking a related question at LSF/MM in Alistair's session: are >> > we sure these things will be folios even before they are assigned to a >> > filesystem? I recall the answer was "yes". >> > >> > So we don't (and will not) support movable_ops for folios. >> >> Is it possible to use some device specific callbacks (DMA?) to copy >> from/to the device private folios (or pages) to/from the normal >> file/anon folios in the future? > > I guess we could put such callbacks on the folio->pgmap, but I'm not sure why > we would want to. Currently all migration to/from device private (or coherent) > folios is managed by the device, which is one of the features of ZONE_DEVICE. Yes. The is the current behavior per my understanding too. > Did you have some particular reason/idea for why we might want to do this? No. Just want to check whether there are some requirements for that. I think that it's just another way to organize code. --- Best Regards, Huang, Ying