lkml.org 
[lkml]   [2008]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86_64: tight online check in setup_per_cpu_areas

* Yinghai Lu <yhlu.kernel@gmail.com> wrote:

> [PATCH] x86_64: tight online check in setup_per_cpu_areas
>
> when numa disabled got compile warning:
> arch/x86/kernel/setup64.c: In function ???setup_per_cpu_areas???:
> arch/x86/kernel/setup64.c:147: warning: the address of ???contig_page_data??? will always evaluate as ???true???
>
> it seems we missed checking if the node is online before we try to
> refer NODE_DATA. so fix it

thanks, applied.

> +#ifndef CONFIG_NEED_MULTIPLE_NODES
> + ptr = alloc_bootmem_pages(size);
> +#else
> + int node = early_cpu_to_node(i);
>
> + if (!node_online(node) || !NODE_DATA(node))
> ptr = alloc_bootmem_pages(size);
> + else
> + ptr = alloc_bootmem_pages_node(NODE_DATA(node), size);
> +#endif

i'm wondering, shouldnt there just be a single facility for this mode of
allocation, instead of this #ifdef and branch maze?

Ingo


\
 
 \ /
  Last update: 2008-03-07 09:43    [W:0.077 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site