Re: [RFC][PATCH 2/8] perf, arch: Use early_initcall() for all arch pmu implementations

From: Paul Mundt
Date: Fri Nov 26 2010 - 02:14:30 EST


On Thu, Nov 25, 2010 at 06:55:59PM +0100, Peter Zijlstra wrote:
> 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?
>
> So the perf_event_init() site is _waaay_ to early to init stuff.. I
> guess I'll move it all to early_initcall() and I'll move the watchdog to
> an explicit call right after it.
>
> Something like the below,.. now I guess the question to all of you is,
> can your arch pmu code cope with early_initcall() or does it need to be
> some other place?
>
Any of the initcall levels are ok for SH at least. The only dependency we
have for the perf code is the clock framework, which comes up during
time_init().
--
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/