Skip to content

mm/memory_hotplug: Factor out memory block devicehandling

David Hildenbrand linux-arm-kernel linux-ia64 linux-mm linux-s390 linux-sh linuxppc-dev lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest11 patches 56 repliesIn review
  2. v28 patches 36 repliesSuperseded
  3. v17 patches 1 replySuperseded

Changes in v3 from the cover letter

- 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.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11mm/memory_hotplug: Simplify and fix check_hotplug_memory_range()mm/memory_hotplug.c+3 -83 replies
2/11s390x/mm: Fail when an altmap is used for arch_add_memory()arch/s390/mm/init.c+3 -05 replies
3/11s390x/mm: Implement arch_remove_memory()arch/s390/mm/init.c+7 -63 replies
4/11arm64/mm: Add temporary arch_remove_memory() implementationarch/arm64/mm/mmu.c+19 -05 replies
5/11drivers/base/memory: Pass a block_id to init_memory_block()drivers/base/memory.c+7 -83 replies
6/11mm/memory_hotplug: Allow arch_remove_pages() without CONFIG_MEMORY_HOTREMOVEarch/arm64/mm/mmu.c arch/ia64/mm/init.c arch/powerpc/mm/mem.c +9 more+0 -289 replies
7/11mm/memory_hotplug: Create memory block devices after arch_add_memory()drivers/base/memory.c include/linux/memory.h mm/memory_hotplug.c+63 -367 replies
8/11mm/memory_hotplug: Drop MHP_MEMBLOCK_APIinclude/linux/memory_hotplug.h mm/memory_hotplug.c+3 -142 replies
9/11mm/memory_hotplug: Remove memory block devices before arch_remove_memory()drivers/base/memory.c drivers/base/node.c include/linux/memory.h +2 more+30 -314 replies
10/11mm/memory_hotplug: Make unregister_memory_block_under_nodes() never faildrivers/base/node.c include/linux/node.h+7 -1610 replies
11/11mm/memory_hotplug: Remove "zone" parameter from sparse_remove_one_sectioninclude/linux/memory_hotplug.h mm/memory_hotplug.c mm/sparse.c+4 -43 replies

Reviews trailers per patch

9 of 11 patches have a Reviewed-by or Acked-by.

PatchDan WilliamsWei YangPavel TatashinOscar SalvadorMichal Hocko
1/11R-b R-b R-b R-b A-b
2/11R-b
3/11
4/11
5/11A-b
6/11R-b
7/11R-b A-b
8/11R-b A-b
9/11R-b A-b
10/11R-b R-b A-b
11/11R-b R-b R-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 5 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/11] mm/memory_hotplug: Factor out memory block devicehandling

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(-)
Signature · 1 line
2.20.1