diff options
author | Salman Qazi <sqazi@google.com> | 2011-11-15 14:12:06 -0800 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-11-16 19:51:25 +0100 |
commit | 4cecf6d401a01d054afc1e5f605bcbfe553cb9b9 (patch) | |
tree | 58978cec1b0757fde61e53c974dff062010713df /kernel | |
parent | fccfdc6f0d8c83c854eeb6d93aa158f0e551bd49 (diff) |
sched, x86: Avoid unnecessary overflow in sched_clock
(Added the missing signed-off-by line)
In hundreds of days, the __cycles_2_ns calculation in sched_clock
has an overflow. cyc * per_cpu(cyc2ns, cpu) exceeds 64 bits, causing
the final value to become zero. We can solve this without losing
any precision.
We can decompose TSC into quotient and remainder of division by the
scale factor, and then use this to convert TSC into nanoseconds.
Signed-off-by: Salman Qazi <sqazi@google.com>
Acked-by: John Stultz <johnstul@us.ibm.com>
Reviewed-by: Paul Turner <pjt@google.com>
Cc: stable@kernel.org
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20111115221121.7262.88871.stgit@dungbeetle.mtv.corp.google.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions