Re: [PATCH] x86: Move per cpu cpu_llc_shared_map to a field instruct cpuinfo_x86

From: Borislav Petkov
Date: Sun Feb 12 2012 - 06:23:06 EST


On Sat, Feb 11, 2012 at 10:18:53PM -0400, Kevin Winchester wrote:
> > @@ -225,7 +225,6 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus)
> > Â Â Â Âfor_each_possible_cpu(i) {
> > Â Â Â Â Â Â Â Âzalloc_cpumask_var(&per_cpu(cpu_sibling_map, i), GFP_KERNEL);
> > Â Â Â Â Â Â Â Âzalloc_cpumask_var(&per_cpu(cpu_core_map, i), GFP_KERNEL);
> > - Â Â Â Â Â Â Â zalloc_cpumask_var(&per_cpu(cpu_llc_shared_map, i), GFP_KERNEL);
> > Â Â Â Â}
> > Â Â Â Âset_cpu_sibling_map(0);
> >
>
> I just realized that I took out a couple of allocations here for
> cpu_llc_shared_map, without replacing them. Am I leaving
> cpuinfo_x86.llc_shared_map unallocated then, and just writing to
> whatever address that field happened to get?

AFAICT, yes, you need to alloc the cpumask too, i.e. something like

zalloc_cpumask_var(cpu_info(i).llc_shared_map, GFP_KERNEL);

assuming this happens before the cpumask gets initted in
set_cpu_sibling_map() et al. Just give the whole init path a hard
staring, and try to figure out the proper init sequence.

HTH.

P.S.: I'm currently travelling but will give your patch a run when I get
back, thanks.

--
Regards/Gruss,
Boris.
--
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/