Re: [PATCH 2/3] Better interface for hooking early initcalls.

From: Eduard - Gabriel Munteanu
Date: Tue Jun 17 2008 - 10:26:34 EST


On Tue, 17 Jun 2008 10:07:42 -0400
Mathieu Desnoyers <compudj@xxxxxxxxxxxxxxxxxx> wrote:

> I am not sure it's worth it trying to define a generic "early"
> initcall, since definition of "how early it is" may change with time.
>
> Currently, it's earlier than SMP init, but later on, it could become
> earlier than mm init. If there are only few users of this, and given
> that they must be designed "knowing" how early they are initialized
> wrt other subsystems, I think it would make sense to call them
> directly from the init code without putting them in a "early
> initcall" category.

I designed this to be "same as other core initcalls, but before SMP".
This isn't a replacement we could use for very early code, such as
kmem_cache_init(). Take into account that CPU hotplug requires this, as
stated in the docs, I quote:
> You need to call register_cpu_notifier() from your init function.
> Init functions could be of two types:
> 1. early init (init function called when only the boot processor is online).
> 2. late init (init function called _after_ all the CPUs are online).

> why not do_one_initcall(*call); ?

I haven't actually tried do_one_initcall() at that point, but it seemed
it messed up with preemption and IRQs. Will check and see if causes any
problems and resubmit if it works. But you do have a point, debugging
should be doable for these initcalls too.

> Mathieu
>
--
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/