Re: [patch 3/4] cpu alloc: The allocator

From: Christoph Lameter
Date: Fri Sep 19 2008 - 09:12:24 EST


Pekka Enberg wrote:
>
>> + *
>> + * (C) 2008 SGI, Christoph Lameter <clameter@xxxxxxx>
>
> You probably want to drop that defunct email address.

Ok.


> I found the first sentence a bit misleading. You can be easily fooled
> into thinking "simultaneously" means there's no global locking (well,
> I was).

Reformulated the sentence.


>> + BUG_ON(index >= nr_units ||
>> + !test_bit(index, cpu_alloc_map) ||
>> + !test_bit(index + units - 1, cpu_alloc_map));
>
> Why not turn this into three separate BUG_ON() calls? It's much easier
> to figure out the offending expression like that. Also, maybe we want
> these to be WARN_ON() calls (and early return) to avoid early boot
> panic?

Ok these are basically for two error conditions:

1. Size to large

2. address out of bounds

So I made them into two bugs.

I thought we could handle early boot panics with early_printk?


>> Index: linux-2.6/arch/x86/kernel/setup_percpu.c
>> ===================================================================
>> --- linux-2.6.orig/arch/x86/kernel/setup_percpu.c 2008-09-16 19:04:30.000000000 -0700
>> +++ linux-2.6/arch/x86/kernel/setup_percpu.c 2008-09-16 19:04:48.000000000 -0700
>> @@ -144,6 +144,7 @@ void __init setup_per_cpu_areas(void)
>> char *ptr;
>> int cpu;
>>
>> + cpu_alloc_init();
>> /* Setup cpu_pda map */
>> setup_cpu_pda_map();
>
> We need to do sparc, powerpc, and ia64 too, right?

Correct.
--
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/