On Thu, 2010-11-25 at 11:25 +0100, Peter Zijlstra wrote: > > Right, so hw perf init happens from (after this patch): > > arch_initcall: powerpc, arm, sh, mips > early_initcall: x86, sparc, alpha > > > Now the problem is that the generic watchdog code (kernel/watchdog.c) > tries to create hw perf events, and that too runs from early_initcall. > > So my question is, how do we go about curing this, because powerpc, arm, > sh and mips are too late and the rest depends on link order to work, not > really a nice situation. > > There's two categories of solutions: > - move the watchdog later, and > - move the hw perf init earlier. > > The former is undesired because we want the watchdog as early as > possible, the later needs new infrastructure (also, I don't know if the > arch implementations can actually run this early). > > So do I create a perf_initcall() or is there another solution that > avoids things like calling the watchdog code from all arch init code? How about something like these? After this we could even look at making the watchdog code an explicit init in main.c right after do_perf_initcalls() (or later if it requires more to be up and running). Hrm,. except that it all builds but doesn't seem to actually work, I guess I need more magics to make the perf_initcall() thing work. /me goes investigate