From: Tang Chen <tangchen@cn.fujitsu.com>
To: mingo@redhat.com, hpa@zytor.com, akpm@linux-foundation.org,
yinghai@kernel.org, jiang.liu@huawei.com, wency@cn.fujitsu.com,
laijs@cn.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com,
tj@kernel.org, mgorman@suse.de, minchan@kernel.org,
mina86@mina86.com, gong.chen@linux.intel.com,
vasilis.liaskovitis@profitbricks.com, lwoodman@redhat.com,
riel@redhat.com, jweiner@redhat.com, prarit@redhat.com
Cc: x86@kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH v3 00/13] Arrange hotpluggable memory in SRAT as ZONE_MOVABLE.
Date: Fri, 24 May 2013 17:29:09 +0800 [thread overview]
Message-ID: <1369387762-17865-1-git-send-email-tangchen@cn.fujitsu.com> (raw)
In memory hotplug situation, the hotpluggable memory should be
arranged in ZONE_MOVABLE because memory in ZONE_NORMAL may be
used by kernel, and Linux cannot migrate pages used by kernel.
So we need a way to specify hotpluggable memory as movable. It
should be as easy as possible.
According to ACPI spec 5.0, SRAT table has memory affinity
structure and the structure has Hot Pluggable Filed.
See "5.2.16.2 Memory Affinity Structure".
If we use the information, we might be able to specify hotpluggable
memory by firmware. For example, if Hot Pluggable Filed is enabled,
kernel sets the memory as movable memory.
To achieve this goal, we need to do the following:
1. Prevent memblock from allocating hotpluggable memroy for kernel.
This is done by reserving hotpluggable memory in memblock as the
folowing steps:
1) Parse SRAT early enough so that memblock knows which memory
is hotpluggable.
2) Add a "flags" member to memblock so that it is able to tell
which memory is hotpluggable when freeing it to buddy.
2. Free hotpluggable memory to buddy system when memory initialization
is done.
3. Arrange hotpluggable memory in ZONE_MOVABLE.
(This will cause NUMA performance decreased)
4. Provide a user interface to enable/disable this functionality.
(This is useful for those who don't use memory hotplug and who don't
want to lose their NUMA performance.)
This patch-set does the following:
patch1: Fix a little problem.
patch2: Have Hot-Pluggable Field in SRAT printed when parsing SRAT.
patch4,5: Introduce hotpluggable field to numa_meminfo.
patch6,7: Introduce flags to memblock, and keep the public APIs prototype
unmodified.
patch8,9: Reserve node-life-cycle memory as MEMBLK_LOCAL_NODE with memblock.
patch10,11: Reserve hotpluggable memory as MEMBLK_HOTPLUGGABLE with memblock,
and free it to buddy when memory initialization is done.
patch3,12,13: Improve "movablecore" boot option to support "movablecore=acpi".
Change log v2 -> v3:
1. As Chen Gong <gong.chen@linux.intel.com> noticed that
memblock_alloc_try_nid() will call panic() if it fails to
allocate memory, so remove the return value check in
setup_node_data() in patch1.
2. Did not movable find_usable_zone_for_movable() forward
to initialize movable_zone. Fixed in patch12.
3. Did not transform reserved->regions[i].base to its PFN
in find_zone_movable_pfns_for_nodes(). Fixed in patch12.
Change log v1 -> v2:
1. Fix a bug in patch10: forgot to update start and end value.
2. Add new patch8: make alloc_low_pages be able to call
memory_add_physaddr_to_nid().
This patch-set is based on Yinghai's
"x86, ACPI, numa: Parse numa info early" patch-set.
Please refer to:
v1: https://lkml.org/lkml/2013/3/7/642
v2: https://lkml.org/lkml/2013/3/10/47
v3: https://lkml.org/lkml/2013/4/4/639
v4: https://lkml.org/lkml/2013/4/11/829
And Yinghai's patch did the following things:
1) Parse SRAT early enough.
2)Allocate pagetable pages in local node.
Tang Chen (12):
acpi: Print Hot-Pluggable Field in SRAT.
page_alloc, mem-hotplug: Improve movablecore to {en|dis}able using
SRAT.
x86, numa, acpi, memory-hotplug: Introduce hotplug info into struct
numa_meminfo.
x86, numa, acpi, memory-hotplug: Consider hotplug info when cleanup
numa_meminfo.
memblock, numa: Introduce flag into memblock.
x86, numa, mem-hotplug: Mark nodes which the kernel resides in.
x86, numa: Move memory_add_physaddr_to_nid() to CONFIG_NUMA.
x86, numa, memblock: Introduce MEMBLK_LOCAL_NODE to mark and reserve
node-life-cycle data.
x86, acpi, numa, mem-hotplug: Introduce MEMBLK_HOTPLUGGABLE to mark
and reserve hotpluggable memory.
x86, memblock, mem-hotplug: Free hotpluggable memory reserved by
memblock.
x86, numa, acpi, memory-hotplug: Make movablecore=acpi have higher
priority.
doc, page_alloc, acpi, mem-hotplug: Add doc for movablecore=acpi boot
option.
Yasuaki Ishimatsu (1):
x86: get pg_data_t's memory from other node
Documentation/kernel-parameters.txt | 8 ++
arch/x86/include/asm/numa.h | 3 +-
arch/x86/kernel/apic/numaq_32.c | 2 +-
arch/x86/mm/amdtopology.c | 3 +-
arch/x86/mm/init.c | 16 +++-
arch/x86/mm/numa.c | 67 +++++++++++++++----
arch/x86/mm/numa_internal.h | 1 +
arch/x86/mm/srat.c | 11 ++-
include/linux/memblock.h | 16 +++++
include/linux/memory_hotplug.h | 3 +
mm/memblock.c | 127 ++++++++++++++++++++++++++++++----
mm/nobootmem.c | 3 +
mm/page_alloc.c | 44 ++++++++++++-
13 files changed, 262 insertions(+), 42 deletions(-)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2013-05-24 9:37 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-24 9:29 Tang Chen [this message]
2013-05-24 9:29 ` [PATCH v3 01/13] x86: get pg_data_t's memory from other node Tang Chen
2013-06-03 0:31 ` Wanpeng Li
2013-06-03 0:31 ` Wanpeng Li
2013-05-24 9:29 ` [PATCH v3 02/13] acpi: Print Hot-Pluggable Field in SRAT Tang Chen
2013-06-03 0:50 ` Wanpeng Li
2013-06-03 0:50 ` Wanpeng Li
2013-05-24 9:29 ` [PATCH v3 03/13] page_alloc, mem-hotplug: Improve movablecore to {en|dis}able using SRAT Tang Chen
2013-06-03 0:52 ` Wanpeng Li
2013-06-03 0:52 ` Wanpeng Li
2013-05-24 9:29 ` [PATCH v3 04/13] x86, numa, acpi, memory-hotplug: Introduce hotplug info into struct numa_meminfo Tang Chen
2013-05-24 9:29 ` [PATCH v3 05/13] x86, numa, acpi, memory-hotplug: Consider hotplug info when cleanup numa_meminfo Tang Chen
2013-05-24 9:29 ` [PATCH v3 06/13] memblock, numa: Introduce flag into memblock Tang Chen
2013-06-03 1:30 ` Wanpeng Li
2013-06-03 1:59 ` Tang Chen
2013-06-03 1:30 ` Wanpeng Li
2013-05-24 9:29 ` [PATCH v3 07/13] x86, numa, mem-hotplug: Mark nodes which the kernel resides in Tang Chen
2013-05-31 16:24 ` Vasilis Liaskovitis
2013-06-03 7:35 ` Tang Chen
2013-06-03 13:18 ` Vasilis Liaskovitis
2013-06-06 9:42 ` Tang Chen
2013-05-24 9:29 ` [PATCH v3 08/13] x86, numa: Move memory_add_physaddr_to_nid() to CONFIG_NUMA Tang Chen
2013-05-24 9:29 ` [PATCH v3 09/13] x86, numa, memblock: Introduce MEMBLK_LOCAL_NODE to mark and reserve node-life-cycle data Tang Chen
2013-05-24 9:29 ` [PATCH v3 10/13] x86, acpi, numa, mem-hotplug: Introduce MEMBLK_HOTPLUGGABLE to mark and reserve hotpluggable memory Tang Chen
2013-05-31 16:15 ` Vasilis Liaskovitis
2013-05-24 9:29 ` [PATCH v3 11/13] x86, memblock, mem-hotplug: Free hotpluggable memory reserved by memblock Tang Chen
2013-06-03 2:57 ` Wanpeng Li
2013-06-03 2:57 ` Wanpeng Li
2013-05-24 9:29 ` [PATCH v3 12/13] x86, numa, acpi, memory-hotplug: Make movablecore=acpi have higher priority Tang Chen
2013-06-03 2:59 ` Wanpeng Li
2013-06-03 7:37 ` Tang Chen
2013-06-03 2:59 ` Wanpeng Li
2013-05-24 9:29 ` [PATCH v3 13/13] doc, page_alloc, acpi, mem-hotplug: Add doc for movablecore=acpi boot option Tang Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1369387762-17865-1-git-send-email-tangchen@cn.fujitsu.com \
--to=tangchen@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=gong.chen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=jiang.liu@huawei.com \
--cc=jweiner@redhat.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lwoodman@redhat.com \
--cc=mgorman@suse.de \
--cc=mina86@mina86.com \
--cc=minchan@kernel.org \
--cc=mingo@redhat.com \
--cc=prarit@redhat.com \
--cc=riel@redhat.com \
--cc=tj@kernel.org \
--cc=vasilis.liaskovitis@profitbricks.com \
--cc=wency@cn.fujitsu.com \
--cc=x86@kernel.org \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox