Skip to content

mm/memory_hotplug: introduce and use PG_offline_skippable

David Hildenbrand linux-mm lkml virtualization 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest1 patch 6 repliesIn review
  2. v12 patches 11 repliesSuperseded

Changes in v2 from the cover letter

* Handle forced driver unloading of virtio-mem: clear the flag
* Added a comment for a PageOfflineSkippable check
* Added more details to the patch description
* Drop patch #2 ("mm/memory_hotplug: remove -EBUSY handling from scan_movable_pages()")

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1mm/memory_hotplug: PG_offline_skippable for offlining memory blocks with PageOffline pagesdrivers/virtio/virtio_mem.c include/linux/page-flags.h mm/memory_hotplug.c +2 more+74 -1426 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchZi YanOscar SalvadorVlastimil Babka
1/1A-b A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/1] mm/memory_hotplug: introduce and use PG_offline_skippable

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. Also tested that forced driver unloading with partially plugged memory blocks keeps working as is.

Cc David Hildenbrand <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Jason Wang <[email protected]>
Cc Xuan Zhuo <[email protected]>
Cc "Eugenio Pérez" <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Brendan Jackman <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Zi Yan <[email protected]>
Cc "Matthew Wilcox (Oracle)" <[email protected]>

v1 -> v2:
* Handle forced driver unloading of virtio-mem: clear the flag
* Added a comment for a PageOfflineSkippable check
* Added more details to the patch description
* Drop patch #2 ("mm/memory_hotplug: remove -EBUSY handling from scan_movable_pages()")

David Hildenbrand (1):
mm/memory_hotplug: PG_offline_skippable for offlining memory blocks
with PageOffline pages

 drivers/virtio/virtio_mem.c | 141 ++++++++----------------------------
 include/linux/page-flags.h  |  29 ++++++--
 mm/memory_hotplug.c         |  17 +++--
 mm/page_alloc.c             |   8 +-
 mm/page_isolation.c         |  21 ++----
 5 files changed, 74 insertions(+), 142 deletions(-)
Signature · 1 line
2.49.0