]> git.baikalelectronics.ru Git - kernel.git/commit
sched: Fix the irqtime code for 32bit
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Thu, 9 Dec 2010 13:15:34 +0000 (14:15 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 16 Dec 2010 10:17:47 +0000 (11:17 +0100)
commit28a83b73be9a6e35031b9ac3f7b32887d6124e0c
tree3a00ccaf8222c994fd7071129dc357321c10c9df
parent0f35faeefe017bf952e0a5555ec105740e197905
sched: Fix the irqtime code for 32bit

Since the irqtime accounting is using non-atomic u64 and can be read
from remote cpus (writes are strictly cpu local, reads are not) we
have to deal with observing partial updates.

When we do observe partial updates the clock movement (in particular,
->clock_task movement) will go funny (in either direction), a
subsequent clock update (observing the full update) will make it go
funny in the oposite direction.

Since we rely on these clocks to be strictly monotonic we cannot
suffer backwards motion. One possible solution would be to simply
ignore all backwards deltas, but that will lead to accounting
artefacts, most notable: clock_task + irq_time != clock, this
inaccuracy would end up in user visible stats.

Therefore serialize the reads using a seqcount.

Reviewed-by: Venkatesh Pallipadi <venki@google.com>
Reported-by: Mikael Pettersson <mikpe@it.uu.se>
Tested-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1292242434.6803.200.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched.c