linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/12] memory-hotplug: hot-remove physical memory
@ 2012-10-23 10:30 wency
  2012-10-23 10:30 ` Ni zhan Chen
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: wency @ 2012-10-23 10:30 UTC (permalink / raw)
  To: x86, linux-mm, linux-kernel, linuxppc-dev, linux-acpi,
	linux-s390, linux-sh, linux-ia64, cmetcalf, sparclinux
  Cc: len.brown, Wen Congyang, isimatu.yasuaki, paulus, minchan.kim,
	kosaki.motohiro, rientjes, cl, akpm, liuj97

From: Wen Congyang <wency@cn.fujitsu.com>

The patch-set was divided from following thread's patch-set.

https://lkml.org/lkml/2012/9/5/201

The last version of this patchset:
https://lkml.org/lkml/2012/10/5/469

If you want to know the reason, please read following thread.

https://lkml.org/lkml/2012/10/2/83

The patch-set has only the function of kernel core side for physical
memory hot remove. So if you use the patch, please apply following
patches.

- bug fix for memory hot remove
  https://lkml.org/lkml/2012/10/19/56
  
- acpi framework
  https://lkml.org/lkml/2012/10/19/156

The patches can free/remove the following things:

  - /sys/firmware/memmap/X/{end, start, type} : [PATCH 2/10]
  - mem_section and related sysfs files       : [PATCH 3-4/10]
  - memmap of sparse-vmemmap                  : [PATCH 5-7/10]
  - page table of removed memory              : [RFC PATCH 8/10]
  - node and related sysfs files              : [RFC PATCH 9-10/10]

* [PATCH 2/10] checks whether the memory can be removed or not.

If you find lack of function for physical memory hot-remove, please let me
know.

How to test this patchset?
1. apply this patchset and build the kernel. MEMORY_HOTPLUG, MEMORY_HOTREMOVE,
   ACPI_HOTPLUG_MEMORY must be selected.
2. load the module acpi_memhotplug
3. hotplug the memory device(it depends on your hardware)
   You will see the memory device under the directory /sys/bus/acpi/devices/.
   Its name is PNP0C80:XX.
4. online/offline pages provided by this memory device
   You can write online/offline to /sys/devices/system/memory/memoryX/state to
   online/offline pages provided by this memory device
5. hotremove the memory device
   You can hotremove the memory device by the hardware, or writing 1 to
   /sys/bus/acpi/devices/PNP0C80:XX/eject.

Note: if the memory provided by the memory device is used by the kernel, it
can't be offlined. It is not a bug.

Known problems:
1. hotremoving memory device may cause kernel panicked
   This bug will be fixed by Liu Jiang's patch:
   https://lkml.org/lkml/2012/7/3/1


Changelogs from v1 to v2:
 Patch1: new patch, offline memory twice. 1st iterate: offline every non primary
         memory block. 2nd iterate: offline primary (i.e. first added) memory
         block.

 Patch3: new patch, no logical change, just remove reduntant codes.

 Patch9: merge the patch from wujianguo into this patch. flush tlb on all cpu
         after the pagetable is changed.

 Patch12: new patch, free node_data when a node is offlined

Wen Congyang (6):
  memory-hotplug: try to offline the memory twice to avoid dependence
  memory-hotplug: remove redundant codes
  memory-hotplug: introduce new function arch_remove_memory() for
    removing page table depends on architecture
  memory-hotplug: remove page table of x86_64 architecture
  memory-hotplug: remove sysfs file of node
  memory-hotplug: free node_data when a node is offlined

Yasuaki Ishimatsu (6):
  memory-hotplug: check whether all memory blocks are offlined or not
    when removing memory
  memory-hotplug: remove /sys/firmware/memmap/X sysfs
  memory-hotplug: unregister memory section on SPARSEMEM_VMEMMAP
  memory-hotplug: implement register_page_bootmem_info_section of
    sparse-vmemmap
  memory-hotplug: remove memmap of sparse-vmemmap
  memory-hotplug: memory_hotplug: clear zone when removing the memory

 arch/ia64/mm/discontig.c             |   14 ++
 arch/ia64/mm/init.c                  |   18 ++
 arch/powerpc/mm/init_64.c            |   14 ++
 arch/powerpc/mm/mem.c                |   12 +
 arch/s390/mm/init.c                  |   12 +
 arch/s390/mm/vmem.c                  |   14 ++
 arch/sh/mm/init.c                    |   17 ++
 arch/sparc/mm/init_64.c              |   14 ++
 arch/tile/mm/init.c                  |    8 +
 arch/x86/include/asm/pgtable_types.h |    1 +
 arch/x86/mm/init_32.c                |   12 +
 arch/x86/mm/init_64.c                |  409 ++++++++++++++++++++++++++++++++++
 arch/x86/mm/pageattr.c               |   47 ++--
 drivers/acpi/acpi_memhotplug.c       |    8 +-
 drivers/base/memory.c                |    6 +
 drivers/firmware/memmap.c            |   98 ++++++++-
 include/linux/firmware-map.h         |    6 +
 include/linux/memory_hotplug.h       |   15 +-
 include/linux/mm.h                   |    5 +-
 mm/memory_hotplug.c                  |  409 ++++++++++++++++++++++++++++++++--
 mm/sparse.c                          |    5 +-
 21 files changed, 1087 insertions(+), 57 deletions(-)

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

end of thread, other threads:[~2012-11-07  7:52 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-23 10:30 [PATCH v2 00/12] memory-hotplug: hot-remove physical memory wency
2012-10-23 10:30 ` Ni zhan Chen
2012-10-23 10:39   ` Wen Congyang
2012-10-23 10:30 ` [PATCH v2 01/12] memory-hotplug: try to offline the memory twice to avoid dependence wency
2012-10-23 10:30 ` [PATCH v2 02/12] memory-hotplug: check whether all memory blocks are offlined or not when removing memory wency
2012-10-23 10:30 ` [PATCH v2 03/12] memory-hotplug: remove redundant codes wency
2012-10-23 10:30 ` [PATCH v2 04/12] memory-hotplug: remove /sys/firmware/memmap/X sysfs wency
2012-10-23 10:30 ` [PATCH v2 05/12] memory-hotplug: introduce new function arch_remove_memory() for removing page table depends on architecture wency
2012-10-23 10:30 ` [PATCH v2 06/12] memory-hotplug: unregister memory section on SPARSEMEM_VMEMMAP wency
2012-10-23 10:30 ` [PATCH v2 07/12] memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap wency
2012-10-23 10:30 ` [PATCH v2 08/12] memory-hotplug: remove memmap " wency
2012-10-23 10:30 ` [PATCH v2 09/12] memory-hotplug: remove page table of x86_64 architecture wency
2012-10-23 10:30 ` [PATCH v2 10/12] memory-hotplug: memory_hotplug: clear zone when removing the memory wency
2012-10-29 15:34   ` Jianguo Wu
2012-10-30  1:50     ` Wen Congyang
2012-11-07  7:40   ` [PATCH] Update start_pfn in zone and pg_data when spanned_pages == 0 Tang Chen
2012-10-23 10:30 ` [PATCH v2 11/12] memory-hotplug: remove sysfs file of node wency
2012-10-23 10:30 ` [PATCH v2 12/12] memory-hotplug: free node_data when a node is offlined wency

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