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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8808C71157 for ; Wed, 18 Jun 2025 17:41:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 69C4F6B00C7; Wed, 18 Jun 2025 13:41:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 625D06B00C8; Wed, 18 Jun 2025 13:41:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4521B8D0001; Wed, 18 Jun 2025 13:41:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 289E06B00C7 for ; Wed, 18 Jun 2025 13:41:38 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id EFBE5C07C1 for ; Wed, 18 Jun 2025 17:41:37 +0000 (UTC) X-FDA: 83569238634.08.A5064DE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf19.hostedemail.com (Postfix) with ESMTP id B5CAD1A0007 for ; Wed, 18 Jun 2025 17:41:35 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Z6yMMp1G; dmarc=pass (policy=quarantine) header.from=redhat.com; spf=pass (imf19.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1750268495; a=rsa-sha256; cv=none; b=DLFFvlJ6M6Q/eN6AdivjXfn2Z8a+HW4CGkhts5jxsX6C+UIdaeXBl7KQZCUnrFGZdOlAOm yLaO9qrtHSL0vjpfrcAG1UyUdPVtOavnuoMrhWAPvgxacFuUNqaXZzlBmhfPdUNxIfJNHI V6SL1qFZ8GnghpLahDGclr9ljYObuIg= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Z6yMMp1G; dmarc=pass (policy=quarantine) header.from=redhat.com; spf=pass (imf19.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1750268495; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=OmfdwaP0f5XUY3WcVBI8N3swmSiQtYBlwUFmuX0ZYxw=; b=wy9IccOLT3DinYJsNKnBgP3u5mvMsqziTWOI9OOV+P4WGq5u2iMbSmO1CrE6Q2eRvKeTsm pDb8XEerIn/nELaaH07gbfGry9InE1u2JQcH2aEpSnfOT6DFlVUu9w5uOxs5LoIIauZbjg xj9+yO4PEzvsKr1ShNU55C7oCtdYX6Y= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1750268495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OmfdwaP0f5XUY3WcVBI8N3swmSiQtYBlwUFmuX0ZYxw=; b=Z6yMMp1Gu5havldyqGB/2kG95QdfpOvg2g+q2nJaavWi8wZMdtVoAiNxGEPC0fHsp9w9yf rt3RUivm/A9T31ODokoJHsg17f0BQ0NChaQSthjBTLFJRrWKJI1WI6NfPsu7ZnRjL+PK1W 6xbeVFfxww/wguamOm+S4XCPXB5ZFro= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-346-Lds_GVBIOQyBwDbjLhGYLA-1; Wed, 18 Jun 2025 13:41:32 -0400 X-MC-Unique: Lds_GVBIOQyBwDbjLhGYLA-1 X-Mimecast-MFC-AGG-ID: Lds_GVBIOQyBwDbjLhGYLA_1750268491 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3a523ce0bb2so3711342f8f.0 for ; Wed, 18 Jun 2025 10:41:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750268491; x=1750873291; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OmfdwaP0f5XUY3WcVBI8N3swmSiQtYBlwUFmuX0ZYxw=; b=DC4UCLuShI90r8QHtWKaI/pb9e06iiULZ6F1vj0axV5RAolXzy5SOtSQidxQm0BZJm gZ91nZoVifBIj6hT2QwTGLEs7vklelsBpto4Js5dfO/g7vBRarOdDPd2hW4sYQ93VQE+ 4l3HhlPdi7DnqLAvBZ8TKBGB1h+C8Tnsj96hNlwbWcTi9CIThAu1NgW1Q2/GxpVSoNU/ QzQLf0vWZ47SzRBazd/dOf+HpkJN7WLP6uByHdddIJDaKLGaTvlHKrKaVEh1/o2xo//r guzm9B87mPOCkhWdS68MPX8I5NmG4hYZX6eKbU9+/K51b4JizF4KBeWWb1Oae3WdHGnO 1pcw== X-Gm-Message-State: AOJu0YxjNrdEtKjIsM/DAhebLOySp/15rb9DgJcfhYCioXIBZ4WjkQyh 7Fsns3g869v5SZnr5VZCT6wY9ktoVatYcqQx0OsD5BP+ZcXyTDWXe1O+dypspQewTKEkRS4DdBR c4ZVRzrIXn/Kri5omGWNbCv8RtEFTflUuR9H8C/7HGGnKqNe8rLol X-Gm-Gg: ASbGncs1Q+o3x+I+KWelulbRmDQRiZN+1gbnDLIKRi5OfX7TJzdas96MAYJgh8gNVxG 6Fl3mVhxjfwCzEuySGUjdIVCpy4ZhCBksYbyTFJstlio4YGien907kjgu9dmBF0JNj75JANU+9z f6RGjVgVEJTVRrKrRcmmemUYKjcYGFDNmmGrCRfkXavsitYn46LnrVVzBfrVAFyLFd3/TfYr0Nq JApLDBjNHn1Y2bzB3MgRZID3Jx47JBVsDGS0ZNb67Z5iaiamv0eRGEQFCH21TAHSpqMUC15uuDu of0Ldut4AhMOZBRAWds9rP3dcNFYpmzdb/Ay0UE+IdoMYAgbnSnDiqb7CddCkHNncDnh85LGDnA UiWJvZg== X-Received: by 2002:a05:6000:178b:b0:3a5:21c8:af31 with SMTP id ffacd0b85a97d-3a5723721bdmr15240237f8f.16.1750268490828; Wed, 18 Jun 2025 10:41:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAZhpZh4slqbXf6Y+7KOO1SPenqI87LsZpqVnArN4AUioCPUgU259IOTbkkNjhv6BPhqHLFQ== X-Received: by 2002:a05:6000:178b:b0:3a5:21c8:af31 with SMTP id ffacd0b85a97d-3a5723721bdmr15240182f8f.16.1750268490320; Wed, 18 Jun 2025 10:41:30 -0700 (PDT) Received: from localhost (p200300d82f2d2400405203b5fff94ed0.dip0.t-ipconnect.de. [2003:d8:2f2d:2400:4052:3b5:fff9:4ed0]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-3a568b2f80asm17518051f8f.78.2025.06.18.10.41.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Jun 2025 10:41:29 -0700 (PDT) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, virtualization@lists.linux.dev, linux-fsdevel@vger.kernel.org, David Hildenbrand , 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 , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Alexander Viro , Christian Brauner , Jan Kara , Zi Yan , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Gregory Price , Ying Huang , Alistair Popple , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , "Matthew Wilcox (Oracle)" , 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: [PATCH RFC 27/29] docs/mm: convert from "Non-LRU page migration" to "movable_ops page migration" Date: Wed, 18 Jun 2025 19:40:10 +0200 Message-ID: <20250618174014.1168640-28-david@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250618174014.1168640-1-david@redhat.com> References: <20250618174014.1168640-1-david@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: sURDMa4YoW7WiZatZfKTQdH4KBflF9vBoXvTG-l9rio_1750268491 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-Stat-Signature: m5zowtu1mfmzshbypwajb34eh154xijw X-Rspamd-Queue-Id: B5CAD1A0007 X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1750268495-328667 X-HE-Meta: U2FsdGVkX1/Bb4+79YaD2HpwMghnLuvHHPw20ZUwUNo+/GRMcEQpQYxvHuODeynUc0oGwRtRrZ0PFRMc486GbpeHiVuT5eqo5xlI0lyaze7zC/8G65VpUwhDdfEF+wT2LBzlpyvjaofyiNR/+dza5Y/8zgd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FseCDE8bgK/aj9lOwjL0vNKtrXpoPBG/GRvxqDItNn51I2XKnUC2SS3iG3fM+84dj3oNT/NpxoFBzDoxJ1ldbenpOUlkOlTbS8h5icyzlk9K3sqA40PnL4RPYSln1/f0EdX/7FTUOgAxytugcQWtBHenBJJmv0Vuv2c/PG2uxwgER3wOxo6aJl7Qj4fGdasj7GKYZMWmGvsBmjByrUI1jMbSsb7OEMCr/DmVqkPbHza77vhSBwtuF8fepDpfdRdOTa1qtmgZQoS452LNhUiKAInpECm9+4tTbWhwvo4pPpDbUfgJEZjmgf1ojfthdIXqRv96Kz5aQ8UOPzpM6sJw+A5sggyGvbHqoIVgCX3 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: List-Subscribe: List-Unsubscribe: Let's bring the docs up-to-date. Signed-off-by: David Hildenbrand --- Documentation/mm/page_migration.rst | 39 ++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/Documentation/mm/page_migration.rst b/Documentation/mm/page_migration.rst index 519b35a4caf5b..a448e95e0a98e 100644 --- a/Documentation/mm/page_migration.rst +++ b/Documentation/mm/page_migration.rst @@ -146,18 +146,33 @@ Steps: 18. The new page is moved to the LRU and can be scanned by the swapper, etc. again. -Non-LRU page migration -====================== - -Although migration originally aimed for reducing the latency of memory -accesses for NUMA, compaction also uses migration to create high-order -pages. For compaction purposes, it is also useful to be able to move -non-LRU pages, such as zsmalloc and virtio-balloon pages. - -If a driver wants to make its pages movable, it should define a struct -movable_operations. It then needs to call __SetPageMovable() on each -page that it may be able to move. This uses the ``page->mapping`` field, -so this field is not available for the driver to use for other purposes. +movable_ops page migration +========================== + +Selected typed, non-folio pages (e.g., pages inflated in a memory balloon, +zsmalloc pages) can be migrated using the movable_ops migration framework. + +The "struct movable_operations" provide callbacks specific to a page type +for isolating, migrating and un-isolating (putback) these pages. + +Once a page is indicated as having movable_ops, that condition must not +change until the page was freed back to the buddy. This includes not +changing/clearing the page type and not changing/clearing the +PG_movable_ops page flag. + +Arbitrary drivers cannot currently make use of this framework, as it +requires: + +(a) a page type +(b) indicating them as possibly having movable_ops in page_has_movable_ops() + based on the page type +(c) returning the movable_ops from page_has_movable_ops() based on the page + type +(d) not reusing the PG_movable_ops and PG_movable_ops_isolated page flags + for other purposes + +For example, balloon drivers can make use of this framework through the +balloon-compaction framework residing in the core kernel. Monitoring Migration ===================== -- 2.49.0