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 7DA59C83F03 for ; Fri, 4 Jul 2025 10:26:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 127756B027D; Fri, 4 Jul 2025 06:26:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D7116B0280; Fri, 4 Jul 2025 06:26:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBA3E6B0281; Fri, 4 Jul 2025 06:26:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D15DF6B027D for ; Fri, 4 Jul 2025 06:26:50 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 988D580284 for ; Fri, 4 Jul 2025 10:26:50 +0000 (UTC) X-FDA: 83626203780.19.03D2ADF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 62F801C0009 for ; Fri, 4 Jul 2025 10:26:48 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DyFY+FBR; spf=pass (imf20.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@redhat.com; dmarc=pass (policy=quarantine) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1751624808; 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=egdaFmDJBU0TtndNYiZ6nPcRML2Mxu7RUt3KjMyWE24=; b=2NvmbKDsL6RhSPTxFSbMbFvBUpiXsosFsEUGJc6wxNwcCkETcRtSOQGisIYwlGhsQBixz3 fAKYD93ZC60GG27DM3cqxQFA7gXRSrF1YHWtPeJf9t/uY9i5CrnIHejBTgtyz4Rs6MOH4P iTUaFezXQmrvLs3hpDQCAxV+bxTUXDA= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DyFY+FBR; spf=pass (imf20.hostedemail.com: domain of dhildenb@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhildenb@redhat.com; dmarc=pass (policy=quarantine) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751624808; a=rsa-sha256; cv=none; b=uXr4STYsvhsWYDaC2bYWVAvRIDSpe3yW6jygST5SjMMsANmtaFhHxsbyj0gRGHXWY+DZAl /TVhJvE9sEcS3xH1CbtH9Nk7smuHcyrmedezZUJ5XV4+Y3pG1J1POwy70hRO0ZjKhlnMqu TV4E6WnofMVYo+V2hnJOaQmOKh9FTgs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751624807; 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=egdaFmDJBU0TtndNYiZ6nPcRML2Mxu7RUt3KjMyWE24=; b=DyFY+FBRt7LaVRd5nCvNOGjvndB/R2SKeF3PuRagNlRwyVPSDnK0p5O+ai1MDryvaJgDGT IAzX6D3qJQCyF4t9xTGzD4InC9lVs44yLiVotOWytKxCdFiLUYRXDids+oAFcrvGp4HW2Y aCQHWQ2LduVVQQ/oy136YA6TwqmtjgQ= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-144-9EbDZgipN1iiFqe-x8Q9dw-1; Fri, 04 Jul 2025 06:26:46 -0400 X-MC-Unique: 9EbDZgipN1iiFqe-x8Q9dw-1 X-Mimecast-MFC-AGG-ID: 9EbDZgipN1iiFqe-x8Q9dw_1751624805 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3a4fabcafecso380689f8f.0 for ; Fri, 04 Jul 2025 03:26:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751624805; x=1752229605; 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=egdaFmDJBU0TtndNYiZ6nPcRML2Mxu7RUt3KjMyWE24=; b=U3JWe8cl9GLM1odvWc89bydvRAcVnc/mR3s+SvUT6HFeIk8BzQayTCAjuepqFPe7/J 31zYWuyYuT6mpcXKpysrJeoNRzABYi0hJRqqt5aG59s9pWH40iY3FhksaaVnxADhlqGX +698j7Xb2yR+5NV+TiF+Z3em+m1QnFEy5tqfBMeAYwdgD2OIw5NJbzSitqoXqCExvqyh sq+wNg5/yBMwyEoCc24hYJ3Iwpjp57CWaFWQm+jBakQZx7rqXSfsG3TLhRbfrrPrNRfL VXtlbr+YYBk8TVw3zflJtLpi7gWZ8SpMTIKVB0nWcat3qwqRS6iLoxTV8ypOOtjQBcEy SAgA== X-Gm-Message-State: AOJu0Yyg7CuJbkDjH+crM+1r9uWhQuZy0FGa7G19Vq15ryDUmBI1X6mr ttUdHYevv8IMgb5OZTPjT5oK1uwcndVGxT1m9LCMwKoIpcSVcvKafA7WbQPSt3RUfQ3izvmVfHv hHXI6YiK85AJHcxbyEwr7D7yFFr3AWieoqI0T7mDnvuSbrzb6Cb2T X-Gm-Gg: ASbGncvd2D8JcMuD4Z05zMV+KY7ZgVLRmZ336igB5ire397/ZKHickgmWy+BwzJOvyN wOlkRS7JmwbR5qGEvKG1v4Uc0IuktMb09Uia+lYt/Unvyq08doeU+5a5tjN0maeWuTbfm9SJh/E MK+GHKKthsXGN6KKmM/cVwvrRmUpi9up4aC2ScuEtUGXEhnpqAJ/xQoirhtbe5zTQAEtpdXBF1N 5buDts9E0hlOuOKjVHuCsy9PEDNWbpmopuHn8sTprYo0jkiKg/vAIb6+YNJ1Zbvd1yjLvwqxhnF MeM4FMw2QSvLoH3KlPDdtp0rk/Gd8wM4ewwuD9PwyE/Lmvxw218U7DsJvRBbQ54vP7U9Pdst8/S W0lFAuA== X-Received: by 2002:a05:6000:41eb:b0:3b3:a6c2:1a10 with SMTP id ffacd0b85a97d-3b4964eb8c5mr1818970f8f.12.1751624805274; Fri, 04 Jul 2025 03:26:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEReO138rar0bBMYwWljLx+rr/cG2x6KKHBHNt6saeQjtIgYNeV27GRLz6HCnNXsrL9yURvTg== X-Received: by 2002:a05:6000:41eb:b0:3b3:a6c2:1a10 with SMTP id ffacd0b85a97d-3b4964eb8c5mr1818905f8f.12.1751624804727; Fri, 04 Jul 2025 03:26:44 -0700 (PDT) Received: from localhost (p200300d82f2c5500098823f9faa07232.dip0.t-ipconnect.de. [2003:d8:2f2c:5500:988:23f9:faa0:7232]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-3b47285c90esm2152102f8f.91.2025.07.04.03.26.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Jul 2025 03:26:44 -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 v2 27/29] docs/mm: convert from "Non-LRU page migration" to "movable_ops page migration" Date: Fri, 4 Jul 2025 12:25:21 +0200 Message-ID: <20250704102524.326966-28-david@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250704102524.326966-1-david@redhat.com> References: <20250704102524.326966-1-david@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 16Uelsn5ivOzrG4XrW3_OrgVdy1NocaiGs9or6_SXas_1751624805 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 62F801C0009 X-Stat-Signature: mdip6cwr3ftno53ck3zyw8o5dpxfyhqm X-Rspam-User: X-HE-Tag: 1751624808-365085 X-HE-Meta: U2FsdGVkX19JFkjxsudnBn9+AF/PUqxD6+MdiQCIrAVysUlWmtxWi5TLkrM/RHQL2i6+CI8+vxTrlu1R2wmNFW1V1OCmoa5ly+Q8btVJp9SeD0XRhQ7530Qyih7iIOL1ZAmtG3FgtvFkgqWC+2d3FSVv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2q4gU5yud1gt+XF8vNOZZ462JKU9nE4bST00w5vL7Jt28dfrnfZVRqJk3zU/t1DUyuBtA+oV+/QUbZ9xJW1SGZyNsbdy3SR4E6BFnEKPTF18wfmLzPxBHvPR3te7s5PuTNO2jsK+1nYlUfj+QHPwoypukaApv6JM5TyORmIVBOXA1SCKqdok83QnIfG03NMIfuRgggi7a9zFtTqd0DJzFxzv5/pcOTBAWOcbkeHt4GAE2AXPTMGcnxiHRO3+P0K8Ll7w3tg6BKbgS5LLqLrqzTweohzfhHGh80/I075z/th/LbfmJB6y+8cqYNQtMNnNwYJ8KphoHsW/cv9bHWY0+S7TBN4/32eb1wQzwd8/97i2HLYFoKpeE8XT/86jzGwK/wzCTp/5ejx8VxfHJBvq4Mp1jGTDJnQxHiSCxvANhX9ENrVyousvIxC2Zso2y8= 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. Reviewed-by: Zi Yan Reviewed-by: Lorenzo Stoakes Reviewed-by: Harry Yoo 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..34602b254aa63 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_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 infrastructure residing in the core kernel. Monitoring Migration ===================== -- 2.49.0