aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memblock.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-07-06 18:39:17 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-08-04 22:56:24 -0400
commit9d1e24928e6a0728d1c7c76818ccbd11b93e7ac9 (patch)
treef2c7173d47bf973d1a42ee249760b1c74d917009 /mm/memblock.c
parentc196f76fd5ece716ee3b7fa5dda3576961c0cecc (diff)
memblock: Separate memblock_alloc_nid() and memblock_alloc_try_nid()
The former is now strict, it will fail if it cannot honor the allocation within the node, while the later implements the previous semantic which falls back to allocating anywhere. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'mm/memblock.c')
-rw-r--r--mm/memblock.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index af7e4d9cf400..1802d97c7284 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -537,9 +537,23 @@ phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int n
537 return ret; 537 return ret;
538 } 538 }
539 539
540 return 0;
541}
542
543phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid)
544{
545 phys_addr_t res = memblock_alloc_nid(size, align, nid);
546
547 if (res)
548 return res;
540 return memblock_alloc(size, align); 549 return memblock_alloc(size, align);
541} 550}
542 551
552
553/*
554 * Remaining API functions
555 */
556
543/* You must call memblock_analyze() before this. */ 557/* You must call memblock_analyze() before this. */
544phys_addr_t __init memblock_phys_mem_size(void) 558phys_addr_t __init memblock_phys_mem_size(void)
545{ 559{