lkml.org 
[lkml]   [2008]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] Better interface for hooking early initcalls.
On Tue, Jun 17, 2008 at 4:07 PM, Mathieu Desnoyers
<compudj@krystal.dyndns.org> wrote:
> * 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.

If this existed already, I'd use it for kmemcheck. We need to hook
into what happens just before SMP is initialized in order to set
maxcpus = 1 depending on some kernel parameter. Right now it's called
directly from do_pre_smp_initcalls():

@@ -779,6 +780,7 @@ static void __init do_pre_smp_initcalls(void)
{
extern int spawn_ksoftirqd(void);

+ kmemcheck_init();
migration_init();
spawn_ksoftirqd();
if (!nosoftlockup)

With proposed patch, we wouldn't have to touch this file at all, so
for what it's worth, consider it acked by me.


Vegard

--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036


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