linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/11] mm/memory_hotplug: Factor out memory block devicehandling
@ 2019-05-27 11:11 David Hildenbrand
  2019-05-27 11:11 ` [PATCH v3 01/11] mm/memory_hotplug: Simplify and fix check_hotplug_memory_range() David Hildenbrand
                   ` (11 more replies)
  0 siblings, 12 replies; 68+ messages in thread
From: David Hildenbrand @ 2019-05-27 11:11 UTC (permalink / raw)
  To: linux-mm
  Cc: Mark Rutland, Oscar Salvador, Rafael J. Wysocki, Michal Hocko,
	linux-ia64, linux-sh, Peter Zijlstra, Dave Hansen, Heiko Carstens,
	Wei Yang, Masahiro Yamada, Pavel Tatashin, Rich Felker, Arun KS,
	Chintan Pandya, Ingo Molnar, Paul Mackerras, Qian Cai, linux-s390,
	H. Peter Anvin, Yu Zhao, Baoquan He, Logan Gunthorpe,
	David Hildenbrand, Mike Rapoport, Jun Yao, Ingo Molnar,
	Catalin Marinas, Rob Herring, Fenghua Yu, Pavel Tatashin,
	Vasily Gorbik, Anshuman Khandual, mike.travis@hpe.com,
	Will Deacon, Robin Murphy, Nicholas Piggin, Martin Schwidefsky,
	Mark Brown, Borislav Petkov, Andy Lutomirski, Jonathan Cameron,
	Dan Williams, Chris Wilson, Joonsoo Kim, linux-arm-kernel,
	Oscar Salvador, Tony Luck, Yoshinori Sato, Ard Biesheuvel,
	Mathieu Malaterre, Greg Kroah-Hartman, Andrew Banman,
	linux-kernel, Mike Rapoport, Thomas Gleixner, Wei Yang,
	Alex Deucher, Igor Mammedov, akpm, linuxppc-dev, David S. Miller,
	Kirill A. Shutemov

We only want memory block devices for memory to be onlined/offlined
(add/remove from the buddy). This is required so user space can
online/offline memory and kdump gets notified about newly onlined memory.

Let's factor out creation/removal of memory block devices. This helps
to further cleanup arch_add_memory/arch_remove_memory() and to make
implementation of new features easier - especially sub-section
memory hot add from Dan.

Anshuman Khandual is currently working on arch_remove_memory(). I added
a temporary solution via "arm64/mm: Add temporary arch_remove_memory()
implementation", that is sufficient as a firsts tep in the context of
this series. (we don't cleanup page tables in case anything goes
wrong already)

Did a quick sanity test with DIMM plug/unplug, making sure all devices
and sysfs links properly get added/removed. Compile tested on s390x and
x86-64.

Based on next/master.

Next refactoring on my list will be making sure that remove_memory()
will never deal with zones / access "struct pages". Any kind of zone
handling will have to be done when offlining system memory / before
removing device memory. I am thinking about remove_pfn_range_from_zone()",
du undo everything "move_pfn_range_to_zone()" did.

v2 -> v3:
- Add "s390x/mm: Fail when an altmap is used for arch_add_memory()"
- Add "arm64/mm: Add temporary arch_remove_memory() implementation"
- Add "drivers/base/memory: Pass a block_id to init_memory_block()"
- Various changes to "mm/memory_hotplug: Create memory block devices
  after arch_add_memory()" and "mm/memory_hotplug: Create memory block
  devices after arch_add_memory()" due to switching from sections to
  block_id's.

v1 -> v2:
- s390x/mm: Implement arch_remove_memory()
-- remove mapping after "__remove_pages"

David Hildenbrand (11):
  mm/memory_hotplug: Simplify and fix check_hotplug_memory_range()
  s390x/mm: Fail when an altmap is used for arch_add_memory()
  s390x/mm: Implement arch_remove_memory()
  arm64/mm: Add temporary arch_remove_memory() implementation
  drivers/base/memory: Pass a block_id to init_memory_block()
  mm/memory_hotplug: Allow arch_remove_pages() without
    CONFIG_MEMORY_HOTREMOVE
  mm/memory_hotplug: Create memory block devices after arch_add_memory()
  mm/memory_hotplug: Drop MHP_MEMBLOCK_API
  mm/memory_hotplug: Remove memory block devices before
    arch_remove_memory()
  mm/memory_hotplug: Make unregister_memory_block_under_nodes() never
    fail
  mm/memory_hotplug: Remove "zone" parameter from
    sparse_remove_one_section

 arch/arm64/mm/mmu.c            |  17 +++++
 arch/ia64/mm/init.c            |   2 -
 arch/powerpc/mm/mem.c          |   2 -
 arch/s390/mm/init.c            |  18 +++--
 arch/sh/mm/init.c              |   2 -
 arch/x86/mm/init_32.c          |   2 -
 arch/x86/mm/init_64.c          |   2 -
 drivers/base/memory.c          | 134 +++++++++++++++++++--------------
 drivers/base/node.c            |  27 +++----
 include/linux/memory.h         |   6 +-
 include/linux/memory_hotplug.h |  12 +--
 include/linux/node.h           |   7 +-
 mm/memory_hotplug.c            |  44 +++++------
 mm/sparse.c                    |  10 +--
 14 files changed, 140 insertions(+), 145 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2019-07-19  6:47 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-27 11:11 [PATCH v3 00/11] mm/memory_hotplug: Factor out memory block devicehandling David Hildenbrand
2019-05-27 11:11 ` [PATCH v3 01/11] mm/memory_hotplug: Simplify and fix check_hotplug_memory_range() David Hildenbrand
2019-05-30 17:53   ` Pavel Tatashin
2019-06-10 16:46   ` Oscar Salvador
2019-07-01  7:42   ` Michal Hocko
2019-05-27 11:11 ` [PATCH v3 02/11] s390x/mm: Fail when an altmap is used for arch_add_memory() David Hildenbrand
2019-06-10 17:07   ` Oscar Salvador
2019-07-01  7:43   ` Michal Hocko
2019-07-01 12:46     ` Michal Hocko
2019-07-15 10:51       ` David Hildenbrand
2019-07-19  6:45         ` Michal Hocko
2019-05-27 11:11 ` [PATCH v3 03/11] s390x/mm: Implement arch_remove_memory() David Hildenbrand
2019-07-01  7:45   ` Michal Hocko
2019-07-01 12:47     ` Michal Hocko
2019-07-15 10:45       ` David Hildenbrand
2019-05-27 11:11 ` [PATCH v3 04/11] arm64/mm: Add temporary arch_remove_memory() implementation David Hildenbrand
2019-06-03 21:41   ` Wei Yang
2019-06-04  6:56     ` David Hildenbrand
2019-06-04 17:36       ` Robin Murphy
2019-06-04 17:51         ` David Hildenbrand
2019-07-01 12:48   ` Michal Hocko
2019-05-27 11:11 ` [PATCH v3 05/11] drivers/base/memory: Pass a block_id to init_memory_block() David Hildenbrand
2019-06-03 21:49   ` Wei Yang
2019-06-04  6:56     ` David Hildenbrand
2019-07-01  7:56   ` Michal Hocko
2019-05-27 11:11 ` [PATCH v3 06/11] mm/memory_hotplug: Allow arch_remove_pages() without CONFIG_MEMORY_HOTREMOVE David Hildenbrand
2019-05-30 17:56   ` Pavel Tatashin
2019-06-03 22:15   ` Wei Yang
2019-06-04  6:59     ` David Hildenbrand
2019-06-04  8:31       ` Wei Yang
2019-06-04  9:00         ` David Hildenbrand
2019-07-01  8:01   ` Michal Hocko
2019-07-01 12:51     ` Michal Hocko
2019-07-15 10:54       ` David Hildenbrand
2019-07-19  6:06         ` Michal Hocko
2019-05-27 11:11 ` [PATCH v3 07/11] mm/memory_hotplug: Create memory block devices after arch_add_memory() David Hildenbrand
2019-05-30 21:07   ` Pavel Tatashin
2019-06-04 21:42   ` Wei Yang
2019-06-05  8:58     ` David Hildenbrand
2019-06-05 10:58       ` David Hildenbrand
2019-06-05 21:22         ` Wei Yang
2019-06-05 21:50           ` David Hildenbrand
2019-07-01  8:14   ` Michal Hocko
2019-05-27 11:11 ` [PATCH v3 08/11] mm/memory_hotplug: Drop MHP_MEMBLOCK_API David Hildenbrand
2019-06-04 21:47   ` Wei Yang
2019-07-01  8:15   ` Michal Hocko
2019-05-27 11:11 ` [PATCH v3 09/11] mm/memory_hotplug: Remove memory block devices before arch_remove_memory() David Hildenbrand
2019-06-04 22:07   ` Wei Yang
2019-06-05  9:00     ` David Hildenbrand
2019-07-01  8:41   ` Michal Hocko
2019-07-15 10:58     ` David Hildenbrand
2019-05-27 11:11 ` [PATCH v3 10/11] mm/memory_hotplug: Make unregister_memory_block_under_nodes() never fail David Hildenbrand
2019-06-05 21:21   ` Wei Yang
2019-06-10 16:56   ` Oscar Salvador
2019-07-01  8:51   ` Michal Hocko
2019-07-01  9:36     ` Oscar Salvador
2019-07-01 10:27       ` Michal Hocko
2019-07-15 11:10         ` David Hildenbrand
2019-07-16  8:46           ` Oscar Salvador
2019-07-16 11:08             ` David Hildenbrand
2019-07-16 11:09             ` David Hildenbrand
2019-07-19  6:05           ` Michal Hocko
2019-05-27 11:11 ` [PATCH v3 11/11] mm/memory_hotplug: Remove "zone" parameter from sparse_remove_one_section David Hildenbrand
2019-06-05 21:21   ` Wei Yang
2019-06-10 16:58   ` Oscar Salvador
2019-07-01  8:52   ` Michal Hocko
2019-06-03 21:21 ` [PATCH v3 00/11] mm/memory_hotplug: Factor out memory block devicehandling Wei Yang
2019-06-03 21:40   ` 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).