linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 00/29] mm/migration: rework movable_ops page migration (part 1)
@ 2025-06-18 17:39 David Hildenbrand
  2025-06-18 17:39 ` [PATCH RFC 01/29] mm/balloon_compaction: we cannot have isolated pages in the balloon list David Hildenbrand
                   ` (28 more replies)
  0 siblings, 29 replies; 93+ messages in thread
From: David Hildenbrand @ 2025-06-18 17:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, linux-doc, linuxppc-dev, virtualization, linux-fsdevel,
	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,
	Eugenio Pérez, 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

Based on mm/mm-new.

In the future, as we decouple "struct page" from "struct folio", pages
that support "non-lru page migration" -- movable_ops page migration
such as memory balloons and zsmalloc -- will no longer be folios. They
will not have ->mapping, ->lru, and likely no refcount and no
page lock. But they will have flags :)

This is the first part (other parts not written yet) of decoupling
movable_ops page migration from folio migration.

In this series, we get rid of the ->mapping usage, and start cleaning up
the code + separating it from folio migration.

Migration core will have to be further reworked to not treat movable_ops
pages like folios. This is the first step into that direction.

RFC because I only did some light testing with virtio-balloon + zsmalloc
page migration, and have to polish some patch descriptions.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Jerrin Shaji George <jerrin.shaji-george@broadcom.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: "Eugenio Pérez" <eperezma@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Gregory Price <gourry@gourry.net>
Cc: Ying Huang <ying.huang@linux.alibaba.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Xu Xin <xu.xin16@zte.com.cn>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Rik van Riel <riel@surriel.com>
Cc: Harry Yoo <harry.yoo@oracle.com>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Shakeel Butt <shakeel.butt@linux.dev>


David Hildenbrand (29):
  mm/balloon_compaction: we cannot have isolated pages in the balloon
    list
  mm/balloon_compaction: convert balloon_page_delete() to
    balloon_page_finalize()
  mm/zsmalloc: drop PageIsolated() related VM_BUG_ONs
  mm/page_alloc: allow for making page types sticky until freed
  mm/balloon_compaction: make PageOffline sticky
  mm/zsmalloc: make PageZsmalloc() sticky
  mm/migrate: rename isolate_movable_page() to
    isolate_movable_ops_page()
  mm/migrate: rename putback_movable_folio() to
    putback_movable_ops_page()
  mm/migrate: factor out movable_ops page handling into
    migrate_movable_ops_page()
  mm/migrate: remove folio_test_movable() and folio_movable_ops()
  mm/migrate: move movable_ops page handling out of move_to_new_folio()
  mm/zsmalloc: stop using __ClearPageMovable()
  mm/balloon_compaction: stop using __ClearPageMovable()
  mm/migrate: remove __ClearPageMovable()
  mm/migration: remove PageMovable()
  mm: rename __PageMovable() to page_has_movable_ops()
  mm/page_isolation: drop __folio_test_movable() check for large folios
  mm: remove __folio_test_movable()
  mm: stop storing migration_ops in page->mapping
  mm: convert "movable" flag in page->mapping to a page flag
  mm: rename PG_isolated to PG_movable_ops_isolated
  mm/page-flags: rename PAGE_MAPPING_MOVABLE to PAGE_MAPPING_ANON_KSM
  mm/page-alloc: remove PageMappingFlags()
  mm/page-flags: remove folio_mapping_flags()
  mm: simplify folio_expected_ref_count()
  mm: rename PAGE_MAPPING_* to FOLIO_MAPPING_*
  docs/mm: convert from "Non-LRU page migration" to "movable_ops page
    migration"
  mm/balloon_compaction: "movable_ops" doc updates
  mm/balloon_compaction: provide single balloon_page_insert() and
    balloon_mapping_gfp_mask()

 Documentation/mm/page_migration.rst  |  39 ++--
 arch/powerpc/platforms/pseries/cmm.c |   2 +-
 drivers/misc/vmw_balloon.c           |   3 +-
 drivers/virtio/virtio_balloon.c      |   4 +-
 fs/proc/page.c                       |   4 +-
 include/linux/balloon_compaction.h   |  90 ++++-----
 include/linux/fs.h                   |   2 +-
 include/linux/migrate.h              |  42 +----
 include/linux/mm.h                   |   4 +-
 include/linux/mm_types.h             |   1 -
 include/linux/page-flags.h           | 104 +++++++----
 include/linux/pagemap.h              |   2 +-
 include/linux/zsmalloc.h             |   2 +
 mm/balloon_compaction.c              |  21 ++-
 mm/compaction.c                      |  44 +----
 mm/gup.c                             |   4 +-
 mm/internal.h                        |   2 +-
 mm/ksm.c                             |   4 +-
 mm/memory-failure.c                  |   4 +-
 mm/memory_hotplug.c                  |   8 +-
 mm/migrate.c                         | 269 +++++++++++++++------------
 mm/page_alloc.c                      |  12 +-
 mm/page_isolation.c                  |  12 +-
 mm/rmap.c                            |  16 +-
 mm/util.c                            |   6 +-
 mm/vmscan.c                          |   6 +-
 mm/zpdesc.h                          |  15 +-
 mm/zsmalloc.c                        |  29 ++-
 28 files changed, 361 insertions(+), 390 deletions(-)


base-commit: 21f39cc0346ea2081a83f0469995144d75d23075
-- 
2.49.0


^ permalink raw reply	[flat|nested] 93+ messages in thread

end of thread, other threads:[~2025-06-30 12:07 UTC | newest]

Thread overview: 93+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18 17:39 [PATCH RFC 00/29] mm/migration: rework movable_ops page migration (part 1) David Hildenbrand
2025-06-18 17:39 ` [PATCH RFC 01/29] mm/balloon_compaction: we cannot have isolated pages in the balloon list David Hildenbrand
2025-06-18 18:32   ` Zi Yan
2025-06-18 17:39 ` [PATCH RFC 02/29] mm/balloon_compaction: convert balloon_page_delete() to balloon_page_finalize() David Hildenbrand
2025-06-18 17:39 ` [PATCH RFC 03/29] mm/zsmalloc: drop PageIsolated() related VM_BUG_ONs David Hildenbrand
2025-06-18 18:37   ` Zi Yan
2025-06-19  2:44   ` Sergey Senozhatsky
2025-06-30  6:49   ` Harry Yoo
2025-06-18 17:39 ` [PATCH RFC 04/29] mm/page_alloc: allow for making page types sticky until freed David Hildenbrand
2025-06-18 18:04   ` Zi Yan
2025-06-18 18:06     ` Matthew Wilcox
2025-06-18 18:09       ` Zi Yan
2025-06-18 18:08     ` Zi Yan
2025-06-23 15:26       ` David Hildenbrand
2025-06-23 15:28         ` Zi Yan
2025-06-30  6:59         ` Harry Yoo
2025-06-18 18:43   ` Zi Yan
2025-06-23 15:27     ` David Hildenbrand
2025-06-18 17:39 ` [PATCH RFC 05/29] mm/balloon_compaction: make PageOffline sticky David Hildenbrand
2025-06-18 18:50   ` Zi Yan
2025-06-23 15:28     ` David Hildenbrand
2025-06-23 15:29       ` Zi Yan
2025-06-30  7:07   ` Harry Yoo
2025-06-18 17:39 ` [PATCH RFC 06/29] mm/zsmalloc: make PageZsmalloc() sticky David Hildenbrand
2025-06-18 18:51   ` Zi Yan
2025-06-19  2:45   ` Sergey Senozhatsky
2025-06-30  7:08   ` Harry Yoo
2025-06-18 17:39 ` [PATCH RFC 07/29] mm/migrate: rename isolate_movable_page() to isolate_movable_ops_page() David Hildenbrand
2025-06-18 18:14   ` Zi Yan
2025-06-18 18:39     ` Matthew Wilcox
2025-06-18 18:48       ` Zi Yan
2025-06-23 15:33         ` David Hildenbrand
2025-06-23 15:42           ` Zi Yan
2025-06-23 15:53             ` David Hildenbrand
2025-06-27 15:37             ` David Hildenbrand
2025-06-29 11:28           ` Huang, Ying
2025-06-30  0:20             ` Alistair Popple
2025-06-30  0:58               ` Huang, Ying
2025-06-30  6:41                 ` Alistair Popple
2025-06-30  8:04   ` Harry Yoo
2025-06-30  8:16     ` David Hildenbrand
2025-06-18 17:39 ` [PATCH RFC 08/29] mm/migrate: rename putback_movable_folio() to putback_movable_ops_page() David Hildenbrand
2025-06-18 19:10   ` Zi Yan
2025-06-18 19:18     ` Matthew Wilcox
2025-06-18 19:25       ` Zi Yan
2025-06-18 20:04         ` Matthew Wilcox
2025-06-23 15:37           ` David Hildenbrand
2025-06-18 17:39 ` [PATCH RFC 09/29] mm/migrate: factor out movable_ops page handling into migrate_movable_ops_page() David Hildenbrand
2025-06-20 19:30   ` Zi Yan
2025-06-18 17:39 ` [PATCH RFC 10/29] mm/migrate: remove folio_test_movable() and folio_movable_ops() David Hildenbrand
2025-06-20 19:36   ` Zi Yan
2025-06-18 17:39 ` [PATCH RFC 11/29] mm/migrate: move movable_ops page handling out of move_to_new_folio() David Hildenbrand
2025-06-20 20:06   ` Zi Yan
2025-06-30 12:07   ` David Hildenbrand
2025-06-18 17:39 ` [PATCH RFC 12/29] mm/zsmalloc: stop using __ClearPageMovable() David Hildenbrand
2025-06-18 17:39 ` [PATCH RFC 13/29] mm/balloon_compaction: " David Hildenbrand
2025-06-30  1:18   ` Huang, Ying
2025-06-30  8:17     ` David Hildenbrand
2025-06-18 17:39 ` [PATCH RFC 14/29] mm/migrate: remove __ClearPageMovable() David Hildenbrand
2025-06-20 20:15   ` Zi Yan
2025-06-23 15:43     ` David Hildenbrand
2025-06-18 17:39 ` [PATCH RFC 15/29] mm/migration: remove PageMovable() David Hildenbrand
2025-06-20 20:19   ` Zi Yan
2025-06-18 17:39 ` [PATCH RFC 16/29] mm: rename __PageMovable() to page_has_movable_ops() David Hildenbrand
2025-06-20 20:37   ` Zi Yan
2025-06-23 15:47     ` David Hildenbrand
2025-06-23 16:05       ` Zi Yan
2025-06-18 17:40 ` [PATCH RFC 17/29] mm/page_isolation: drop __folio_test_movable() check for large folios David Hildenbrand
2025-06-20 20:38   ` Zi Yan
2025-06-18 17:40 ` [PATCH RFC 18/29] mm: remove __folio_test_movable() David Hildenbrand
2025-06-20 20:41   ` Zi Yan
2025-06-30 10:38   ` David Hildenbrand
2025-06-18 17:40 ` [PATCH RFC 19/29] mm: stop storing migration_ops in page->mapping David Hildenbrand
2025-06-20 20:45   ` Zi Yan
2025-06-18 17:40 ` [PATCH RFC 20/29] mm: convert "movable" flag in page->mapping to a page flag David Hildenbrand
2025-06-23 14:14   ` Zi Yan
2025-06-23 15:50     ` David Hildenbrand
2025-06-18 17:40 ` [PATCH RFC 21/29] mm: rename PG_isolated to PG_movable_ops_isolated David Hildenbrand
2025-06-23 14:16   ` Zi Yan
2025-06-18 17:40 ` [PATCH RFC 22/29] mm/page-flags: rename PAGE_MAPPING_MOVABLE to PAGE_MAPPING_ANON_KSM David Hildenbrand
2025-06-23 14:17   ` Zi Yan
2025-06-18 17:40 ` [PATCH RFC 23/29] mm/page-alloc: remove PageMappingFlags() David Hildenbrand
2025-06-23 14:20   ` Zi Yan
2025-06-18 17:40 ` [PATCH RFC 24/29] mm/page-flags: remove folio_mapping_flags() David Hildenbrand
2025-06-23 14:20   ` Zi Yan
2025-06-18 17:40 ` [PATCH RFC 25/29] mm: simplify folio_expected_ref_count() David Hildenbrand
2025-06-23 14:23   ` Zi Yan
2025-06-18 17:40 ` [PATCH RFC 26/29] mm: rename PAGE_MAPPING_* to FOLIO_MAPPING_* David Hildenbrand
2025-06-23 14:25   ` Zi Yan
2025-06-18 17:40 ` [PATCH RFC 27/29] docs/mm: convert from "Non-LRU page migration" to "movable_ops page migration" David Hildenbrand
2025-06-23 14:28   ` Zi Yan
2025-06-18 17:40 ` [PATCH RFC 28/29] mm/balloon_compaction: "movable_ops" doc updates David Hildenbrand
2025-06-18 17:40 ` [PATCH RFC 29/29] mm/balloon_compaction: provide single balloon_page_insert() and balloon_mapping_gfp_mask() David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).