Re: [patch] Re: 2.6.16-rc4-mm1 (bugs and lockups)

From: Andrew Morton
Date: Tue Feb 21 2006 - 20:43:33 EST


Stas Sergeev <stsp@xxxxxxxx> wrote:
>
> main.c: moved smp_prepare_boot_cpu() call earlier. This
> was necessary because otherwise printk() can't print
> It checks cpu_online(), which returns false. This change
> is consistent with the UP case, where's the boot CPU is
> "online" from the very beginning, AFAICS. But again, I am
> not entirely sure whether this is safe.
>

Yeah, this is scary. Early boot is fragile and complex and architectures
might not expect to run smp_prepare_boot_cpu() before setup_arch().

umm, actually it's wrong. i386's smp_prepare_boot_cpu() diddles with
per-cpu memory, and that's not initialised at that stage. See the call to
setup_per_cpu_areas() a few lines later.

So I'll drop that hunk. How important is it in practice?

If it's purely to make printk print something then perhaps we can do
something expedient like:

#ifdef CONFIG_SMP
cpu_set(smp_processor_id(), cpu_online_map); /* comment */
#endif

right there in start_kernel()?

(That assumes that smp_processor_id() works at that stage. Surely that's
true).
-
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/