Re: Scheduler bug related to rq->skip_clock_update?

From: Bjoern B. Brandenburg
Date: Mon Dec 06 2010 - 10:40:35 EST




On Mon, 6 Dec 2010, Mike Galbraith wrote:

> On Sun, 2010-12-05 at 13:28 +0800, Yong Zhang wrote:
>
> > when we init idle task, we doesn't mark it on_rq.
> > My test show the concern is smoothed by below patch.
>
> Close :)
>
> The skip_clock_update flag should only be set if rq->curr is on_rq,
> because it it _that_ clock update during dequeue, and subsequent
> microscopic vruntime update it causes that we're trying to avoid.
>
> I think the below fixes it up properly.
>
> Sched: fix skip_clock_update optimization

Mike, Yong,

thanks for looking into this. On the x86_64 host, I'm now see seeing
delays of less than 0.1ms, which seems fine. On the ARM host, I'm seeing
delays of up to ~2.5ms. However, this only happens on CPU0, which makes me
think that it is probably just a byproduct of interrupts.

bbb@district10:~$ egrep 'cpu#|skip' /proc/sched_debug
cpu#0
.skip_clock_count : 98494
.skip_clock_recent_max : 2543000
.skip_clock_max : 9876875
cpu#1
.skip_clock_count : 61084
.skip_clock_recent_max : 861750
.skip_clock_max : 1382875
cpu#2
.skip_clock_count : 60846
.skip_clock_recent_max : 193375
.skip_clock_max : 2236500
cpu#3
.skip_clock_count : 60270
.skip_clock_recent_max : 318750
.skip_clock_max : 1679000
bbb@district10:~$ cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
33: 29 0 0 0 GIC timer
35: 49 0 0 0 GIC isp1760-hcd:usb1
36: 145 0 0 0 GIC uart-pl011
39: 10 0 0 0 GIC kmi-pl050
40: 116 0 0 0 GIC kmi-pl050
41: 215789 0 0 0 GIC eth0
46: 0 0 0 0 GIC mmci-pl18x (cmd)
47: 0 0 0 0 GIC mmci-pl18x (pio)
IPI: 102721 103079 94532 111227
LOC: 115129 114840 114166 115122
Err: 0

So the latest patch seems to solve the issue.

Tested-by: Bjoern B. Brandenburg <bbb.lst@xxxxxxxxx>

Btw, I think this patch is a good candidate for the .36-stable tree since
it fixes a major regression.

Thanks,
Bjoern
--
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/