Re: [PATCH] x86_64: tight online check in setup_per_cpu_areas

From: Ingo Molnar
Date: Fri Mar 07 2008 - 03:41:30 EST



* Yinghai Lu <yhlu.kernel@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/