memblock-introduce-bottom-up-allocation-mode.patch removed from -mm tree
[email protected]
maintainerSubject: [merged] memblock-introduce-bottom-up-allocation-mode.patch removed from -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]
From: [email protected]
Date: Wed, 13 Nov 2013 12:38:59 -0800
The patch titled
Subject: mm/memblock.c: introduce bottom-up allocation mode
has been removed from the -mm tree. Its filename was
memblock-introduce-bottom-up-allocation-mode.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
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 | 24 ++++++++++ include/linux/mm.h | 4 + mm/memblock.c | 83 +++++++++++++++++++++++++++++++++++-- 3 files changed, 108 insertions(+), 3 deletions(-)
include/linux/memblock.h renamed from include/linux/memblock.h~memblock-introduce-bottom-up-allocation-mode +24 -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,29 @@ 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 +/* +* Set the allocation direction to bottom-up or top-down. +*/ +static inline void memblock_set_bottom_up (bool enable) +{ + memblock.bottom_up = enable; +} + +/* +* Check if the allocation direction is bottom-up or not. +* if this is true, that said, memblock will allocate memory +* in bottom-up direction. +*/ +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
include/linux/mm.h renamed from include/linux/mm.h~memblock-introduce-bottom-up-allocation-mode +4 -0
@@ -50,6 +50,10 @@ extern int sysctl_legacy_va_layout;#include <asm/pgtable.h> #include <asm/processor.h> +#ifndef __pa_symbol +#define __pa_symbol (x) __pa(RELOC_HIDE((unsigned long)(x), 0)) +#endif +extern unsigned long sysctl_user_reserve_kbytes;extern unsigned long sysctl_admin_reserve_kbytes;
mm/memblock.c renamed from mm/memblock.c~memblock-introduce-bottom-up-allocation-mode +80 -3
131 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are
origin.patch
linux-next.patch