public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <compudj@krystal.dyndns.org>
To: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: tzanussi@gmail.com, linux-kernel@vger.kernel.org,
	penberg@cs.helsinki.fi, akpm@linux-foundation.org,
	torvalds@linux-foundation.org
Subject: Re: [PATCH 2/3] Better interface for hooking early initcalls.
Date: Tue, 17 Jun 2008 10:07:42 -0400	[thread overview]
Message-ID: <20080617140742.GD10316@Krystal> (raw)
In-Reply-To: <20080615180508.71d1cbcc@linux360.ro>

* 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

  reply	other threads:[~2008-06-17 14:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-15 15:05 [PATCH 2/3] Better interface for hooking early initcalls Eduard - Gabriel Munteanu
2008-06-17 14:07 ` Mathieu Desnoyers [this message]
2008-06-17 14:26   ` Eduard - Gabriel Munteanu
2008-06-17 14:43   ` Vegard Nossum
  -- strict thread matches above, loose matches on Subject: below --
2008-06-21 14:10 Eduard - Gabriel Munteanu
2008-06-22 19:22 ` Pekka Enberg
2008-06-22 20:38   ` Eduard - Gabriel Munteanu
2008-06-22 20:43     ` Vegard Nossum
2008-06-22 20:45       ` Pekka Enberg
2008-06-22 21:05         ` Eduard - Gabriel Munteanu
2008-06-22 21:01       ` Eduard - Gabriel Munteanu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080617140742.GD10316@Krystal \
    --to=compudj@krystal.dyndns.org \
    --cc=akpm@linux-foundation.org \
    --cc=eduard.munteanu@linux360.ro \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=torvalds@linux-foundation.org \
    --cc=tzanussi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox