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 0AC1DC8302D for ; Mon, 30 Jun 2025 13:02:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8C97D6B00C7; Mon, 30 Jun 2025 09:01:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A1F46B00C8; Mon, 30 Jun 2025 09:01:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B8446B00C9; Mon, 30 Jun 2025 09:01:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 6A5C96B00C7 for ; Mon, 30 Jun 2025 09:01:49 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 421C5BA070 for ; Mon, 30 Jun 2025 13:01:49 +0000 (UTC) X-FDA: 83612079138.22.02D040F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 0C666C0002 for ; Mon, 30 Jun 2025 13:01:46 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=d1QBOjUw; spf=pass (imf10.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=1751288507; 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=Zjoj4LwixqS2sGyUbKyFkbKZVx00WcQgc8KQk63N+Nk=; b=X8KibHjM0NQn44eL/6treBDVNabfkvpxlst0ek8OBXe8kdMibi2YLAfS4yNSxkA7k0OZcq kvCQQpStnlRMdIwAWVK4eDLGQn3sl/XNinVxNpvb7gMtNKR1K8MT9E7UqS9V1NoNq0gUiW TbT4QP9zH+IUsUlxQEEPOaNj2eyx9jg= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=d1QBOjUw; spf=pass (imf10.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=1751288507; a=rsa-sha256; cv=none; b=3SP+fUvWziOz+kCAV5G8yzjeKc0HjwUGZQ5knowhPTm+2n61tSRGiKljA/96PorV5HV/Rq xvyocFCNYSjcWadaJJC2GcQ8kd54cGcXbBebcyKPw9mAcw+VOtoTHVBBwn4n/t6N9JH1qO FkJ1hCNqSWslizoJ2PTkKwgXd63Wjq4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751288506; 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=Zjoj4LwixqS2sGyUbKyFkbKZVx00WcQgc8KQk63N+Nk=; b=d1QBOjUwNJqXuRFmsitNYIUUTBUmJ/dcQg7t1dQWPM5o9ZnKvp9T8JlGjPZ0EgaWP/L5DU NvuhaXEEJEsqM0Npw0z5xSr2uavgO6MFVsEGwStr7VyCkN9oGz38G7D/JGZaiW0DrvRaoE YRwrpUTKNyfEk7EcCPrmYs8czE6Kcrg= 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-426-lDXqXO8KOUKvoX75OkP48A-1; Mon, 30 Jun 2025 09:01:38 -0400 X-MC-Unique: lDXqXO8KOUKvoX75OkP48A-1 X-Mimecast-MFC-AGG-ID: lDXqXO8KOUKvoX75OkP48A_1751288497 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3a50816ccc6so1397387f8f.1 for ; Mon, 30 Jun 2025 06:01:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751288497; x=1751893297; 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=Zjoj4LwixqS2sGyUbKyFkbKZVx00WcQgc8KQk63N+Nk=; b=nu11WutvqOkeS1588uOviBd2rcNDKb5IzKVmieT/ta15Owr2JBW0AUoDlWcwAlKGgF JdAwl44eUI9De4oX6ci9OeayhhUxrPOrBPzkIbtC9wTNLKuBx0pTDxPmUpIPsi0Iubmn sRMcefcRj2hrL9hYFjsCl6SAeE0muM9uHQoWiHThdzcDCaroXvIjVXqFEzN503W0gIpO JOrl+kkXfnAcQAbvehgnTh8qicqSQrnZx5HTX+9FbqL4Q/3Hxnj91I7BVW9om2YwTTcF bHdcA1AKOcWTAVx1xpPFfSaY+07I+1yHOUNsVOV2+7I+C0gI71SzCyiys7mSU/acKihI RSUQ== X-Gm-Message-State: AOJu0YzwWkPmralfNbRMXV0g2FadqGK4E5wK7isLSO0w+82fpt7UvIml qfn+x03lnY535QfKta+te1fi0swDrBP78yOj/rlpysauo6Wi24e1AZzxeuEOkIxYHtwG3xxZkAx bCTa+4CXRxIy8qCuSFY6jPk9LIZ7MQ84JgzzjdD2nLPChy2kzGfzB X-Gm-Gg: ASbGnctgCFHEOWS4OlOVYJFOYlb+76h+lJCisKDd2IGOQoqnpA0XaljB+epSZxgYT+D V3XPse5vQEQhoYfktvJBT6k03JRiSKYWDcs8Nv1PkSFniUXfaayigVKgePwcpnfAo6SEJ7woqmR dECUl1a/hHjkFQON1pPOfLUQ9gWuLOBigwnhPn487a8IyP7LhRTOP3xR3nOesL5VjNRy2xGJn5Z 6LFq1EodpB4Jicppi9N+Zpp/hz4Gclu2qGkU01WbP0VAvjb2oepjEfUeKg0LJxcoXG1cJ9sghJ4 Zz7S280Wt00+Jed+ZOHovtlYE+O4G41ruW9xEPORD+jgH4NFgqwz3YHlEUTxXTv+2iZtIVSPrFY FvUIJFzs= X-Received: by 2002:a05:6000:41f2:b0:3a4:efc0:c90b with SMTP id ffacd0b85a97d-3a8f482bd78mr11299182f8f.15.1751288496456; Mon, 30 Jun 2025 06:01:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUx6MnmvL38m+UjxsSHRmCnwJ9csff/jtPLhL/sKkb+ObakA6KxkyBM5ParmF0iwuWxCWprQ== X-Received: by 2002:a05:6000:41f2:b0:3a4:efc0:c90b with SMTP id ffacd0b85a97d-3a8f482bd78mr11299087f8f.15.1751288495708; Mon, 30 Jun 2025 06:01:35 -0700 (PDT) Received: from localhost (p200300d82f40b30053f7d260aff47256.dip0.t-ipconnect.de. [2003:d8:2f40:b300:53f7:d260:aff4:7256]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-3ac6ee0d0b9sm4643102f8f.18.2025.06.30.06.01.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Jun 2025 06:01:35 -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 v1 27/29] docs/mm: convert from "Non-LRU page migration" to "movable_ops page migration" Date: Mon, 30 Jun 2025 15:00:08 +0200 Message-ID: <20250630130011.330477-28-david@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250630130011.330477-1-david@redhat.com> References: <20250630130011.330477-1-david@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: VfKwKoPR6HcCbeuuKZPcPc9fOzHf5YqoEeVkJ_KiG_E_1751288497 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-Stat-Signature: adh6wdtkn4twhom344jci4b1m3bgtp1c X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 0C666C0002 X-Rspam-User: X-HE-Tag: 1751288506-637517 X-HE-Meta: U2FsdGVkX1+JU2Hqeco7NUhpPZ0nEioxTyQ8XuWXsl38A1nfrT+BaSnh/sH5BJWIUUyKAvCBwjW7n1JHFCGaSIJxC7cpxxQpDizZVy0VYEFfisvICYWL2UKEdmE/HhIX7xvzDYYo9H0UxjEOWOEoNYMQJlFMG8uy/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sb7mplClT/oKnZwNeBUlN7P38y6jke482jUx3NWmjT3Zn+tF5AlM4z08ohXv/0vh/YR2BGYhwMaUCbLrBjS4+W9HlfM948/xTj8EfGdOlooq9LSMgzI57tqZtgryjXoKC9f46HMUnyEdCyHbhi7RN5V34uAScRVOmCz7ogeHymH5LGYps6bRZPZ2YqRppqTFKGOCHbBxuVORosu1brxJRtuHyIPogcHB7qdcZKlsIRPVt0xxhw/OWVaILJCMyLmZJrSkIkSgOmau+aXJmgHI3D315Hl5Cx0ulZU4G/ZGQ2zFculaHMtksvpklE64cifI6dbzqraSCoDrBeQ88KVAdg49tAse349lCzAV2qQnf2rYVjL79HsoyHnrQO1reDIzdNhBGuj09uJhhMNV8GivNQQehfaw== 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 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..d611bc21920d7 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 infrastructure residing in the core kernel. Monitoring Migration ===================== -- 2.49.0