Re: [PATCH 3/7] Add IRQ_TIME_ACCOUNTING, finer accounting of irq time -v3

From: Venkatesh Pallipadi
Date: Fri Oct 01 2010 - 19:32:57 EST


On Fri, Oct 1, 2010 at 4:14 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Fri, 2010-10-01 at 10:29 -0700, Venkatesh Pallipadi wrote:
>> So, on x86, sched_clock_stable is not set on all other kind of CPUs
>> and my test system happens to be one of them. So, sched_clock_cpu()
>> falls back to tick based even when TSC is not marked unstable and
>> clocksource is using TSC for timing.
>
> It is never tick based!! It's tick augmented! Because TSC is such a
> piece of crap we use external (slow) means of determining a window in
> which the TSC should live and then use the TSC to generate high
> resolution offsets inside that.
>
> So even if your usage is in the hardirq context that moves that window
> it should all work out.
>

You mean there should not be any "jumps" noticed with
sched_clock_cpu() when we are idle and get a interrupt?
Atleast thats what I am seeing. May be there is some other bug
somewhere causing that.

Loooking at one snapshot from my earlier log

<idle>-0 [] 1697.915040: : START 1700899887146
// We were idle and got an interrupt and recorded sched_clock_cpu() as
1700899887146
<idle>-0 [] 1697.915047: : HARD STOP 1700902008678, delta 2121532
// We finished handling the interrupt and recorded sched_clock_cpu()
as 1700902008678
// So, delta we see is > 2ms
// This is trace_printk based on local clock, which is using sched_clock()
// So, the trace timing shows delta of 7 us, which is kind of expected time here
--
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/