]> git.baikalelectronics.ru Git - kernel.git/commit
vtime: Use consistent clocks among nohz accounting
authorFrederic Weisbecker <fweisbec@gmail.com>
Wed, 15 May 2013 20:16:32 +0000 (22:16 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 31 May 2013 09:31:50 +0000 (11:31 +0200)
commit7252926715ac6bd11d9cfd9c7372dac90dd5409e
tree47b131fb39077451fe247a96c0fc98ab142b79fa
parent152372a26de4f41ce8bb9d22df40c5dea8c99d47
vtime: Use consistent clocks among nohz accounting

While computing the cputime delta of dynticks CPUs,
we are mixing up clocks of differents natures:

* local_clock() which takes care of unstable clock
sources and fix these if needed.

* sched_clock() which is the weaker version of
local_clock(). It doesn't compute any fixup in case
of unstable source.

If the clock source is stable, those two clocks are the
same and we can safely compute the difference against
two random points.

Otherwise it results in random deltas as sched_clock()
can randomly drift away, back or forward, from local_clock().

As a consequence, some strange behaviour with unstable tsc
has been observed such as non progressing constant zero cputime.
(The 'top' command showing no load).

Fix this by only using local_clock(), or its irq safe/remote
equivalent, in vtime code.

Reported-by: Mike Galbraith <efault@gmx.de>
Suggested-by: Mike Galbraith <efault@gmx.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/vtime.h
kernel/sched/core.c
kernel/sched/cputime.c