lkml.org 
[lkml]   [2008]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2/3] Better interface for hooking early initcalls.
* Eduard - Gabriel Munteanu (eduard.munteanu@linux360.ro) wrote:
> Added early initcall (pre-SMP) support, using an identical interface to
> that of regular initcalls. Functions called from do_pre_smp_initcalls()
> could be converted to use this cleaner interface.
>
> This is required by CPU hotplug, because early users have to register
> notifiers before going SMP. One such CPU hotplug user is the relay
> interface with buffer-only channels, which needs to register such a
> notifier, to be usable in early code. This in turn is used by kmemtrace.
>

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.

> Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
....
> -extern initcall_t __initcall_start[], __initcall_end[];
> +extern initcall_t __initcall_start[], __initcall_end[], __early_initcall_end[];
>
> static void __init do_initcalls(void)
> {
> initcall_t *call;
>
> - for (call = __initcall_start; call < __initcall_end; call++)
> + for (call = __early_initcall_end; call < __initcall_end; call++)
> do_one_initcall(*call);
>
> /* Make sure there is no pending stuff from the initcall sequence */
> @@ -775,6 +775,14 @@ static int __init nosoftlockup_setup(char *str)
> }
> __setup("nosoftlockup", nosoftlockup_setup);
>
> +static void __init __do_pre_smp_initcalls(void)
> +{
> + initcall_t *call;
> +
> + for (call = __initcall_start; call < __early_initcall_end; call++)
> + (*call)();

why not do_one_initcall(*call); ?

Mathieu

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68


\
 
 \ /
  Last update: 2008-06-17 16:11    [W:0.041 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site