bab9bb6b69
Create new directories: ceph config config-files filesystem kernel kernel/kernel-modules ldap logging strorage-drivers tools utilities virt Retire directories: connectivity core devtools support extended Delete two packages: tgt irqbalance Relocated packages: base/ dhcp initscripts libevent lighttpd linuxptp memcached net-snmp novnc ntp openssh pam procps sanlock shadow sudo systemd util-linux vim watchdog ceph/ python-cephclient config/ facter puppet-4.8.2 puppet-modules filesystem/ e2fsprogs nfs-utils nfscheck kernel/ kernel-std kernel-rt kernel/kernel-modules/ mlnx-ofa_kernel ldap/ nss-pam-ldapd openldap logging/ syslog-ng logrotate networking/ lldpd iproute mellanox python-ryu mlx4-config python/ python-2.7.5 python-django python-gunicorn python-setuptools python-smartpm python-voluptuous security/ shim-signed shim-unsigned tboot strorage-drivers/ python-3parclient python-lefthandclient virt/ cloud-init libvirt libvirt-python qemu tools/ storage-topology vm-topology utilities/ tis-extensions namespace-utils nova-utils update-motd Change-Id: I37ade764d873c701b35eac5881eb40412ba64a86 Story: 2002801 Task: 22687 Signed-off-by: Scott Little <scott.little@windriver.com>
97 lines
3.8 KiB
Diff
97 lines
3.8 KiB
Diff
From b4007dff3d6d7fc27d8b3431213202fb9c34793d Mon Sep 17 00:00:00 2001
|
|
Message-Id: <b4007dff3d6d7fc27d8b3431213202fb9c34793d.1527544850.git.Jim.Somerville@windriver.com>
|
|
In-Reply-To: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
|
|
References: <b6ceef1c915827b50ce3f76da4dc47f3eb768b44.1527544850.git.Jim.Somerville@windriver.com>
|
|
From: Akinobu Mita <akinobu.mita@gmail.com>
|
|
Date: Tue, 31 May 2016 16:07:55 -0400
|
|
Subject: [PATCH 09/26] memblock: introduce memblock_alloc_range()
|
|
|
|
Commit 2bfc2862c4fe38379a2fb2cfba33fad32ccb4ff4 upstream
|
|
Backported-by: Nam Ninh <nam.ninh@windriver.com>
|
|
|
|
This introduces memblock_alloc_range() which allocates memblock from the
|
|
specified range of physical address. I would like to use this function
|
|
to specify the location of CMA.
|
|
|
|
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
|
|
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
|
|
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
|
Cc: David Woodhouse <dwmw2@infradead.org>
|
|
Cc: Don Dutile <ddutile@redhat.com>
|
|
Cc: Thomas Gleixner <tglx@linutronix.de>
|
|
Cc: Ingo Molnar <mingo@redhat.com>
|
|
Cc: "H. Peter Anvin" <hpa@zytor.com>
|
|
Cc: Andi Kleen <andi@firstfloor.org>
|
|
Cc: Yinghai Lu <yinghai@kernel.org>
|
|
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
|
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
|
---
|
|
include/linux/memblock.h | 2 ++
|
|
mm/memblock.c | 22 ++++++++++++++++++----
|
|
2 files changed, 20 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
|
|
index 5a439c9..d6bcbef 100644
|
|
--- a/include/linux/memblock.h
|
|
+++ b/include/linux/memblock.h
|
|
@@ -304,6 +304,8 @@ static inline bool memblock_bottom_up(void) { return false; }
|
|
#define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0)
|
|
#define MEMBLOCK_ALLOC_ACCESSIBLE 0
|
|
|
|
+phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align,
|
|
+ phys_addr_t start, phys_addr_t end);
|
|
phys_addr_t memblock_alloc_base(phys_addr_t size, phys_addr_t align,
|
|
phys_addr_t max_addr);
|
|
phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align,
|
|
diff --git a/mm/memblock.c b/mm/memblock.c
|
|
index fbc8071..ff910a4 100644
|
|
--- a/mm/memblock.c
|
|
+++ b/mm/memblock.c
|
|
@@ -1120,9 +1120,9 @@ int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size,
|
|
}
|
|
#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
|
|
|
|
-static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size,
|
|
- phys_addr_t align, phys_addr_t max_addr,
|
|
- int nid, ulong flags)
|
|
+static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size,
|
|
+ phys_addr_t align, phys_addr_t start,
|
|
+ phys_addr_t end, int nid, ulong flags)
|
|
{
|
|
phys_addr_t found;
|
|
|
|
@@ -1132,7 +1132,7 @@ static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size,
|
|
/* align @size to avoid excessive fragmentation on reserved array */
|
|
size = round_up(size, align);
|
|
|
|
- found = memblock_find_in_range_node(size, align, 0, max_addr, nid,
|
|
+ found = memblock_find_in_range_node(size, align, start, end, nid,
|
|
flags);
|
|
if (found && !memblock_reserve(found, size))
|
|
return found;
|
|
@@ -1140,6 +1140,20 @@ static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size,
|
|
return 0;
|
|
}
|
|
|
|
+phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align,
|
|
+ phys_addr_t start, phys_addr_t end)
|
|
+{
|
|
+ ulong flags = choose_memblock_flags();
|
|
+ return memblock_alloc_range_nid(size, align, start, end, NUMA_NO_NODE, flags);
|
|
+}
|
|
+
|
|
+static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size,
|
|
+ phys_addr_t align, phys_addr_t max_addr,
|
|
+ int nid, ulong flags)
|
|
+{
|
|
+ return memblock_alloc_range_nid(size, align, 0, max_addr, nid, flags);
|
|
+}
|
|
+
|
|
phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid)
|
|
{
|
|
ulong flags = choose_memblock_flags();
|
|
--
|
|
1.8.3.1
|
|
|