+ memblock-introduce-bottom-up-allocation-mode.patch added to -mm tree
[email protected]
maintainerSubject: + memblock-introduce-bottom-up-allocation-mode.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Wed, 25 Sep 2013 17:05:22 -0700
The patch titled
Subject: mm/memblock.c: introduce bottom-up allocation mode
has been added to the -mm tree. Its filename is
memblock-introduce-bottom-up-allocation-mode.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/memblock-introduce-bottom-up-allocation-mode.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/memblock-introduce-bottom-up-allocation-mode.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Tang Chen <[email protected]>
Subject: mm/memblock.c: introduce bottom-up allocation mode
The Linux kernel cannot migrate pages used by the kernel. As a result, kernel pages cannot be hot-removed. So we cannot allocate hotpluggable memory for the kernel.
ACPI SRAT (System Resource Affinity Table) contains the memory hotplug info. But before SRAT is parsed, memblock has already started to allocate memory for the kernel. So we need to prevent memblock from doing this.
In a memory hotplug system, any numa node the kernel resides in should be unhotpluggable. And for a modern server, each node could have at least 16GB memory. So memory around the kernel image is highly likely unhotpluggable.
So the basic idea is: Allocate memory from the end of the kernel image and to the higher memory. Since memory allocation before SRAT is parsed won't be too much, it could highly likely be in the same node with kernel image.
The current memblock can only allocate memory top-down. So this patch introduces a new bottom-up allocation mode to allocate memory bottom-up. And later when we use this allocation direction to allocate memory, we will limit the start address above the kernel.
---
include/linux/memblock.h | 16 +++++++ mm/memblock.c | 81 ++++++++++++++++++++++++++++++++++++- 2 files changed, 95 insertions(+), 2 deletions(-)
include/linux/memblock.h renamed from include/linux/memblock.h~memblock-introduce-bottom-up-allocation-mode +16 -0
@@ -35,6 +35,7 @@ struct memblock_type { };struct memblock { +bool bottom_up;/* is bottom up direction? */ phys_addr_t current_limit;struct memblock_type memory;struct memblock_type reserved;
@@ -148,6 +149,21 @@ phys_addr_t memblock_alloc_try_nid(phys_phys_addr_t memblock_alloc (phys_addr_t size,phys_addr_t align); +#ifdef CONFIG_MOVABLE_NODE +static inline void memblock_set_bottom_up (bool enable) +{ + memblock.bottom_up = enable; +} + +static inline bool memblock_bottom_up (void ) +{ +return memblock.bottom_up; +} +#else +static inline void memblock_set_bottom_up (bool enable) {} +static inline bool memblock_bottom_up (void ) {return false; } +#endif +/* Flags for memblock_alloc_base() amd __memblock_alloc_base() */ #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0)#define MEMBLOCK_ALLOC_ACCESSIBLE 0
mm/memblock.c renamed from mm/memblock.c~memblock-introduce-bottom-up-allocation-mode +79 -2
123 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are
memblock-factor-out-of-top-down-allocation.patch memblock-introduce-bottom-up-allocation-mode.patch x86-mm-factor-out-of-top-down-direct-mapping-setup.patch x86-mem-hotplug-support-initialize-page-tables-in-bottom-up.patch x86-acpi-crash-kdump-do-reserve_crashkernel-after-srat-is-parsed.patch mem-hotplug-introduce-movablenode-boot-option.patch