Re: [patch 0/2] NOHZ vs. profile/oprofile v2

From: Ingo Molnar
Date: Mon Jun 22 2009 - 10:41:32 EST



* Martin Schwidefsky <schwidefsky@xxxxxxxxxx> wrote:

> On Tue, 9 Jun 2009 22:52:51 +0200 (CEST)
> Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
> > > version 2 of the profile patches. The only change is the in_interrupt()
> > > fix in tick_nohz_stop_idle(). I would like to know how to proceed with
> > > the issue.
> > > Andy, do you still prefer to handle the old style profiler analog to
> > > the oprofile patch? If yes I would drop patch #1 and extend patch #2
> > > with another tick_nohz_disable().
> >
> > Any update on this one ?
>
> A solution to this problem should go upstream soon, no? How about this
> patch, it uses the tick_nohz_disable/tick_nohz_enable mechanic for
> oprofile and the old style kernel profiler. Good enough ?
>
> ---
> Subject: [PATCH] keep on ticking if a profiler is active
>
> From: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
>
> On a NOHZ system with oprofile or the old style kernel profiler enabled
> the timer tick should not be stopped when a cpu goes idle. Currently
> a maximum of 1 tick is accounted if a cpu sleeps for a longer period of
> time. This does bad things to the percentages in the profiler output.
>
> Signed-off-by: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
> ---
>
> drivers/oprofile/oprof.c | 3 +++
> include/linux/tick.h | 4 ++++
> kernel/profile.c | 4 ++++
> kernel/time/tick-sched.c | 27 ++++++++++++++++++++++++++-
> 4 files changed, 37 insertions(+), 1 deletion(-)

Hm, this is rather ugly. Why not use hrtimers like 'perf' does when
it fallback-samples based on the timer tick?

That method has three advantages:

- no weird hookery needed
- resolution can go far beyond HZ
- it is evidently dynticks-safe

Ingo
--
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/