linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH part5 0/7] Arrange hotpluggable memory as ZONE_MOVABLE.
@ 2013-08-08 10:16 Tang Chen
  2013-08-08 10:16 ` [PATCH part5 1/7] x86: get pg_data_t's memory from other node Tang Chen
                   ` (8 more replies)
  0 siblings, 9 replies; 48+ messages in thread
From: Tang Chen @ 2013-08-08 10:16 UTC (permalink / raw)
  To: robert.moore, lv.zheng, rjw, lenb, tglx, mingo, hpa, akpm, tj,
	trenn, yinghai, jiang.liu, wency, laijs, isimatu.yasuaki,
	izumi.taku, mgorman, minchan, mina86, gong.chen,
	vasilis.liaskovitis, lwoodman, riel, jweiner, prarit,
	zhangyanfei, yanghy
  Cc: x86, linux-doc, linux-kernel, linux-mm, linux-acpi

[Problem]

The current Linux cannot migrate pages used by the kerenl because
of the kernel direct mapping. In Linux kernel space, va = pa + PAGE_OFFSET.
When the pa is changed, we cannot simply update the pagetable and
keep the va unmodified. So the kernel pages are not migratable.

There are also some other issues will cause the kernel pages not migratable.
For example, the physical address may be cached somewhere and will be used.
It is not to update all the caches.

When doing memory hotplug in Linux, we first migrate all the pages in one
memory device somewhere else, and then remove the device. But if pages are
used by the kernel, they are not migratable. As a result, memory used by
the kernel cannot be hot-removed.

Modifying the kernel direct mapping mechanism is too difficult to do. And
it may cause the kernel performance down and unstable. So we use the following
way to do memory hotplug.


[What we are doing]

In Linux, memory in one numa node is divided into several zones. One of the
zones is ZONE_MOVABLE, which the kernel won't use.

In order to implement memory hotplug in Linux, we are going to arrange all
hotpluggable memory in ZONE_MOVABLE so that the kernel won't use these memory.

To do this, we need ACPI's help.


[How we do this]

In ACPI, SRAT(System Resource Affinity Table) contains NUMA info. The memory
affinities in SRAT record every memory range in the system, and also, flags
specifying if the memory range is hotpluggable.
(Please refer to ACPI spec 5.0 5.2.16)

With the help of SRAT, we have to do the following two things to achieve our
goal:

1. When doing memory hot-add, allow the users arranging hotpluggable as
   ZONE_MOVABLE.
   (This has been done by the MOVABLE_NODE functionality in Linux.)

2. when the system is booting, prevent bootmem allocator from allocating
   hotpluggable memory for the kernel before the memory initialization
   finishes.
   (This is what we are going to do. See below.)


[About this patch-set]

In previous parts' patches, we have obtained SRAT earlier enough, right after
memblock is ready. So this patch-set does the following things:

1. Improve memblock to support flags, which are used to indicate different 
   memory type.

2. Mark all hotpluggable memory in memblock.memory[].

3. Make the default memblock allocator skip hotpluggable memory.

4. Introduce "movablenode" boot option to allow users to enable/disable this
   functionality.


Tang Chen (6):
  x86, numa, mem_hotplug: Skip all the regions the kernel resides in.
  memblock, numa: Introduce flag into memblock.
  memblock, mem_hotplug: Introduce MEMBLOCK_HOTPLUG flag to mark
    hotpluggable regions.
  memblock, mem_hotplug: Make memblock skip hotpluggable regions by
    default.
  mem-hotplug: Introduce movablenode boot option to {en|dis}able using
    SRAT.
  x86, numa, acpi, memory-hotplug: Make movablenode have higher
    priority.

Yasuaki Ishimatsu (1):
  x86: get pg_data_t's memory from other node

 Documentation/kernel-parameters.txt |   15 ++++++
 arch/x86/kernel/setup.c             |   10 +++-
 arch/x86/mm/numa.c                  |    5 +-
 include/linux/memblock.h            |   13 +++++
 include/linux/memory_hotplug.h      |    3 +
 mm/memblock.c                       |   92 +++++++++++++++++++++++++++++------
 mm/memory_hotplug.c                 |   56 +++++++++++++++++++++-
 mm/page_alloc.c                     |   31 +++++++++++-
 8 files changed, 201 insertions(+), 24 deletions(-)


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

end of thread, other threads:[~2013-08-15  5:17 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-08 10:16 [PATCH part5 0/7] Arrange hotpluggable memory as ZONE_MOVABLE Tang Chen
2013-08-08 10:16 ` [PATCH part5 1/7] x86: get pg_data_t's memory from other node Tang Chen
2013-08-12 14:39   ` Tejun Heo
2013-08-12 15:12     ` Tang Chen
2013-08-08 10:16 ` [PATCH part5 2/7] x86, numa, mem_hotplug: Skip all the regions the kernel resides in Tang Chen
2013-08-08 10:16 ` [PATCH part5 3/7] memblock, numa: Introduce flag into memblock Tang Chen
2013-08-08 10:16 ` [PATCH part5 4/7] memblock, mem_hotplug: Introduce MEMBLOCK_HOTPLUG flag to mark hotpluggable regions Tang Chen
2013-08-08 10:16 ` [PATCH part5 5/7] memblock, mem_hotplug: Make memblock skip hotpluggable regions by default Tang Chen
2013-08-14 21:54   ` Naoya Horiguchi
2013-08-15  5:15     ` Tang Chen
2013-08-08 10:16 ` [PATCH part5 6/7] mem-hotplug: Introduce movablenode boot option to {en|dis}able using SRAT Tang Chen
2013-08-08 10:16 ` [PATCH part5 7/7] x86, numa, acpi, memory-hotplug: Make movablenode have higher priority Tang Chen
2013-08-09 16:32 ` [PATCH part5 0/7] Arrange hotpluggable memory as ZONE_MOVABLE Tejun Heo
2013-08-12  8:54   ` Tang Chen
2013-08-12 14:50 ` Tejun Heo
2013-08-12 15:14   ` H. Peter Anvin
2013-08-12 15:23     ` Tejun Heo
2013-08-12 16:29       ` Tang Chen
2013-08-12 16:46         ` Tejun Heo
2013-08-12 18:23           ` Tang Chen
2013-08-12 20:20             ` Tejun Heo
2013-08-13  6:14           ` Tang Chen
2013-08-13  9:56             ` Tang Chen
2013-08-13 14:38               ` Tejun Heo
2013-08-12 15:41   ` Tang Chen
2013-08-12 15:46     ` Tejun Heo
2013-08-12 16:19       ` Tang Chen
2013-08-12 16:22         ` Tejun Heo
2013-08-12 17:01           ` Tang Chen
2013-08-12 17:23             ` H. Peter Anvin
2013-08-14 18:22               ` KOSAKI Motohiro
2013-08-12 18:07             ` Tejun Heo
2013-08-14 18:15               ` KOSAKI Motohiro
2013-08-14 18:23                 ` Tejun Heo
2013-08-14 19:40                   ` KOSAKI Motohiro
2013-08-14 19:55                     ` Tejun Heo
2013-08-14 20:29                       ` KOSAKI Motohiro
2013-08-14 20:30                         ` H. Peter Anvin
2013-08-14 20:35                         ` Tejun Heo
2013-08-14 21:17                           ` KOSAKI Motohiro
2013-08-14 21:36                             ` Tejun Heo
2013-08-15  1:08                               ` KOSAKI Motohiro
2013-08-15  1:21                                 ` Tejun Heo
2013-08-15  1:33                                   ` Tejun Heo
2013-08-15  1:44                                     ` KOSAKI Motohiro
2013-08-15  2:22                                       ` Tejun Heo
2013-08-15  1:38                                   ` KOSAKI Motohiro
2013-08-15  1:51                                     ` Tejun Heo

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