Re: [patch] Fix large MCA bootmem allocation

Hidetoshi Seto
2008-02-06T00:30:17Z

Russ Anderson wrote:
> The MCA code allocates bootmem memory for NR_CPUS, regardless
> of how many cpus the system actually has.

So... how about using num_possible_cpus() instead?

> @@ -1762,11 +1762,8 @@ format_mca_init_stack(void *mca_data, un
> /* Caller prevents this from being called after init */
> static void * __init_refok mca_bootmem(void)
> {
> - void *p;
> -
> - p = alloc_bootmem(sizeof(struct ia64_mca_cpu) * NR_CPUS +
> - KERNEL_STACK_SIZE);
> - return (void *)ALIGN((unsigned long)p, KERNEL_STACK_SIZE);
> + return __alloc_bootmem(sizeof(struct ia64_mca_cpu),
> + KERNEL_STACK_SIZE, 0);
> }
>
> /* Do per-CPU MCA-related initialization. */

i.e.
p = alloc_bootmem(sizeof(struct ia64_mca_cpu) * num_possible_cpus() +
KERNEL_STACK_SIZE);

Thanks,
H.Seto