lkml.org 
[lkml]   [2018]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 14/29] memblock: add align parameter to memblock_alloc_node()
Date
With the align parameter memblock_alloc_node() can be used as drop in
replacement for alloc_bootmem_pages_node().

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
---
include/linux/bootmem.h | 4 ++--
mm/sparse.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 7d91f0f..3896af2 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -157,9 +157,9 @@ static inline void * __init memblock_alloc_from_nopanic(
}

static inline void * __init memblock_alloc_node(
- phys_addr_t size, int nid)
+ phys_addr_t size, phys_addr_t align, int nid)
{
- return memblock_alloc_try_nid(size, 0, BOOTMEM_LOW_LIMIT,
+ return memblock_alloc_try_nid(size, align, BOOTMEM_LOW_LIMIT,
BOOTMEM_ALLOC_ACCESSIBLE, nid);
}

diff --git a/mm/sparse.c b/mm/sparse.c
index 04e97af..509828f 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -68,7 +68,7 @@ static noinline struct mem_section __ref *sparse_index_alloc(int nid)
if (slab_is_available())
section = kzalloc_node(array_size, GFP_KERNEL, nid);
else
- section = memblock_alloc_node(array_size, nid);
+ section = memblock_alloc_node(array_size, 0, nid);

return section;
}
--
2.7.4
\
 
 \ /
  Last update: 2018-09-05 18:02    [W:0.921 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site