Skip to content

powerpc/pseries: CMM: Implement balloon compaction and remove isolate notifier

David Hildenbrand linux-mm linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12powerpc/pseries: CMM: Implement release() function for sysfs devicearch/powerpc/platforms/pseries/cmm.c+5 -03 replies
2/12powerpc/pseries: CMM: Report errors when registering notifiers failsarch/powerpc/platforms/pseries/cmm.c+6 -20 replies
3/12powerpc/pseries: CMM: Cleanup rc handling in cmm_init()arch/powerpc/platforms/pseries/cmm.c+3 -40 replies
4/12powerpc/pseries: CMM: Drop page arrayarch/powerpc/platforms/pseries/cmm.c+36 -1270 replies
5/12powerpc/pseries: CMM: Use adjust_managed_page_count() insted of totalram_pages_*arch/powerpc/platforms/pseries/cmm.c+3 -30 replies
6/12powerpc/pseries: CMM: Rip out memory isolate notifierarch/powerpc/platforms/pseries/cmm.c+1 -960 replies
7/12powerpc/pseries: CMM: Convert loaned_pages to an atomic_long_tarch/powerpc/platforms/pseries/cmm.c+19 -160 replies
8/12powerpc/pseries: CMM: Implement balloon compactionarch/powerpc/platforms/pseries/Kconfig arch/powerpc/platforms/pseries/cmm.c include/uapi/linux/magic.h+120 -144 replies
9/12powerpc/pseries: CMM: Switch to balloon_page_alloc()arch/powerpc/platforms/pseries/cmm.c+1 -20 replies
10/12powerpc/pseries: CMM: Simulation modearch/powerpc/platforms/pseries/cmm.c+30 -80 replies
11/12mm: remove the memory isolate notifierdrivers/base/memory.c include/linux/memory.h mm/page_isolation.c+2 -710 replies
12/12mm: remove "count" parameter from has_unmovable_pages()include/linux/page-isolation.h mm/memory_hotplug.c mm/page_alloc.c +1 more+11 -180 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1 00/12] powerpc/pseries: CMM: Implement balloon compaction and remove isolate notifier

This is the follow-up of:

	https://lkml.org/lkml/2019/9/10/711

We can get rid of the memory isolate notifier by switching to balloon compaction in powerpc's CMM (Collaborative Memory Management). The memory isolate notifier was only necessary to allow to offline memory blocks that contain inflated/"loaned" pages - which also possible when the inflated pages are movable (via balloon compaction). Having movable pages implies that memory will also no longer get fragmented when CMM is active.

While I do have access to a LPAR, it does not have CMM active and I have np clue how to enable it. Instead, I implemented a simple simulation mode. I did some tests and the whole infrastructure, including page migration, seems to work fine (e.g., I can still offline memory blocks that contain inflated pages). Of course, I cannot tell if HW will like the changes, especially:

1. I now use page_to_phys() to come up with the addresses to report to the hypervisor. Hope that's correct.
2. When migrating a page, I first inflate/"loan" the new page and then deflate the old page. I have no idea if HW accepts to set pages loaned if it didn't request a loan. I assume it does.
3. We might now inflate/deflate pages in parallel (of course, not the same page). I have no idea if HW likes that.

It would be good if somebody could either point me at the spec of the hypervisor interface or verify directly. Also, it would be good if somebody could test with actual HW that has this feature.

Cc Alexander Duyck <[email protected]>
Cc Alexander Potapenko <[email protected]>
Cc Alexey Kardashevskiy <[email protected]>
Cc Allison Randal <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Anshuman Khandual <[email protected]>
Cc Anshuman Khandual <[email protected]>
Cc Arun KS <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Dan Williams <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc David Howells <[email protected]>
Cc "Enrico Weigelt, metux IT consult" <[email protected]>
Cc Gao Xiang <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Greg Hackmann <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Konstantin Khlebnikov <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc "Oliver O'Halloran" <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Pavel Tatashin <[email protected]>
Cc Pingfan Liu <[email protected]>
Cc Qian Cai <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Richard Fontana <[email protected]>
Cc Stephen Rothwell <[email protected]>
Cc Thiago Jung Bauermann <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Todd Kjos <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Wei Yang <[email protected]>

David Hildenbrand (12):
powerpc/pseries: CMM: Implement release() function for sysfs device powerpc/pseries: CMM: Report errors when registering notifiers fails powerpc/pseries: CMM: Cleanup rc handling in cmm_init() powerpc/pseries: CMM: Drop page array
powerpc/pseries: CMM: Use adjust_managed_page_count() insted of
totalram_pages_*
powerpc/pseries: CMM: Rip out memory isolate notifier powerpc/pseries: CMM: Convert loaned_pages to an atomic_long_t powerpc/pseries: CMM: Implement balloon compaction powerpc/pseries: CMM: Switch to balloon_page_alloc() powerpc/pseries: CMM: Simulation mode
mm: remove the memory isolate notifier
mm: remove "count" parameter from has_unmovable_pages()

 arch/powerpc/platforms/pseries/Kconfig |   1 +
 arch/powerpc/platforms/pseries/cmm.c   | 430 +++++++++++--------------
 drivers/base/memory.c                  |  19 --
 include/linux/memory.h                 |  27 --
 include/linux/page-isolation.h         |   4 +-
 include/uapi/linux/magic.h             |   1 +
 mm/memory_hotplug.c                    |   2 +-
 mm/page_alloc.c                        |  21 +-
 mm/page_isolation.c                    |  27 +-
 9 files changed, 204 insertions(+), 328 deletions(-)
Signature · 1 line
2.21.0