lkml.org 
[lkml]   [2013]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 08/23] mm/memblock: Add memblock memory allocation apis
On Mon, Dec 09, 2013 at 04:50:41PM -0500, Santosh Shilimkar wrote:
> Introduce memblock memory allocation APIs which allow to support
> PAE or LPAE extension on 32 bits archs where the physical memory
> start address can be beyond 4GB. In such cases, existing bootmem
> APIs which operate on 32 bit addresses won't work and needs
> memblock layer which operates on 64 bit addresses.

The overall API looks good to me. Thanks for doing this!

> +static void * __init memblock_virt_alloc_internal(
> + phys_addr_t size, phys_addr_t align,
> + phys_addr_t min_addr, phys_addr_t max_addr,
> + int nid)
> +{
> + phys_addr_t alloc;
> + void *ptr;
> +
> + if (nid == MAX_NUMNODES)
> + pr_warn("%s: usage of MAX_NUMNODES is depricated. Use NUMA_NO_NODE\n",
> + __func__);

Why not use WARN_ONCE()? Also, shouldn't nid be set to NUMA_NO_NODE
here?

...
> + if (nid != NUMA_NO_NODE) {

Otherwise, the above test is broken.

> + alloc = memblock_find_in_range_node(size, align, min_addr,
> + max_addr, NUMA_NO_NODE);
> + if (alloc)
> + goto done;
> + }

Thanks.

--
tejun


\
 
 \ /
  Last update: 2013-12-13 23:21    [W:0.288 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site