linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] mm/memory_hotplug: introduce and use PG_offline_skippable
@ 2025-05-14 11:15 David Hildenbrand
  2025-05-14 11:15 ` [PATCH v1 1/2] mm/memory_hotplug: PG_offline_skippable for offlining memory blocks with PageOffline pages David Hildenbrand
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: David Hildenbrand @ 2025-05-14 11:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, virtualization, David Hildenbrand, Michael S. Tsirkin,
	Jason Wang, Xuan Zhuo, Eugenio Pérez, Andrew Morton,
	Oscar Salvador, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Brendan Jackman, Johannes Weiner, Zi Yan, Matthew Wilcox (Oracle)

This is a requirement for making PageOffline pages not have a refcount
in the long future ("frozen"), and for reworking non-folio page migration
in the near future.

I have patches mostly ready to go to handle the latter. For turning all
PageOffline() pages frozen, the non-folio page migration and memory
ballooning drivers will have to be reworked first, to no longer rely on
the refcount of PageOffline pages.

Introduce PG_offline_skippable that only applies to PageOffline() pages --
of course, reusing one of the existing PG_ flags for now -- and convert
virtio-mem to make use of the new way: to allow for skipping PageOffline
pages during memory offlining, treating them as if they would not be
allocated.

Note that the existing mechanism relied on the driver (virtio-mem)
dropping its reference during MEM_GOING_OFFLINE, which is complicated and
not compatible with the concept of frozen pages (no refcount).

Tested with virtio-mem on x86, including  partially hotplugging a memory
block (hotplugging 64MiB with a 128 MiB memory block size), and repeatedly
onlining+offlining the memory block.

Cc: David Hildenbrand <david@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: "Eugenio Pérez" <eperezma@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Zi Yan <ziy@nvidia.com>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>

David Hildenbrand (2):
  mm/memory_hotplug: PG_offline_skippable for offlining memory blocks
    with PageOffline pages
  mm/memory_hotplug: remove -EBUSY handling from scan_movable_pages()

 drivers/virtio/virtio_mem.c | 111 +-----------------------------------
 include/linux/page-flags.h  |  29 +++++++---
 mm/memory_hotplug.c         |  22 ++-----
 mm/page_alloc.c             |   8 +--
 mm/page_isolation.c         |  21 +++----
 5 files changed, 40 insertions(+), 151 deletions(-)


base-commit: 2f6baf8dadecc2bec7d6bc931f7e0d58d8443d76
-- 
2.49.0



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

end of thread, other threads:[~2025-05-19 14:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-14 11:15 [PATCH v1 0/2] mm/memory_hotplug: introduce and use PG_offline_skippable David Hildenbrand
2025-05-14 11:15 ` [PATCH v1 1/2] mm/memory_hotplug: PG_offline_skippable for offlining memory blocks with PageOffline pages David Hildenbrand
2025-05-14 19:00   ` Zi Yan
2025-05-14 19:51     ` David Hildenbrand
2025-05-14 20:30       ` Zi Yan
2025-05-19 14:39         ` David Hildenbrand
2025-05-14 11:15 ` [PATCH v1 2/2] mm/memory_hotplug: remove -EBUSY handling from scan_movable_pages() David Hildenbrand
2025-05-14 19:57   ` David Hildenbrand
2025-05-14 13:45 ` [PATCH v1 0/2] mm/memory_hotplug: introduce and use PG_offline_skippable Zi Yan
2025-05-14 14:12   ` David Hildenbrand
2025-05-14 15:49     ` Zi Yan
2025-05-14 17:28       ` David Hildenbrand
2025-05-14 17:43         ` Zi Yan
2025-05-14 17:46           ` 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).