aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/handler.c
diff options
context:
space:
mode:
authorPeter Zijlstra <[email protected]>2013-11-18 17:27:06 +0000
committerIngo Molnar <[email protected]>2013-12-11 14:52:35 +0000
commit9dbdb155532395ba000c5d5d187658b0e17e529f (patch)
treea01fb4066fbad520f364abc0bb7b68f45aab3100 /net/tipc/handler.c
parentmath64: Add mul_u64_u32_shr() (diff)
downloadkernel-9dbdb155532395ba000c5d5d187658b0e17e529f.tar.gz
kernel-9dbdb155532395ba000c5d5d187658b0e17e529f.zip
sched/fair: Rework sched_fair time accounting
Christian suffers from a bad BIOS that wrecks his i5's TSC sync. This results in him occasionally seeing time going backwards - which crashes the scheduler ... Most of our time accounting can actually handle that except the most common one; the tick time update of sched_fair. There is a further problem with that code; previously we assumed that because we get a tick every TICK_NSEC our time delta could never exceed 32bits and math was simpler. However, ever since Frederic managed to get NO_HZ_FULL merged; this is no longer the case since now a task can run for a long time indeed without getting a tick. It only takes about ~4.2 seconds to overflow our u32 in nanoseconds. This means we not only need to better deal with time going backwards; but also means we need to be able to deal with large deltas. This patch reworks the entire code and uses mul_u64_u32_shr() as proposed by Andy a long while ago. We express our virtual time scale factor in a u32 multiplier and shift right and the 32bit mul_u64_u32_shr() implementation reduces to a single 32x32->64 multiply if the time delta is still short (common case). For 64bit a 64x64->128 multiply can be used if ARCH_SUPPORTS_INT128. Reported-and-Tested-by: Christian Engelmayer <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] Cc: Paul Turner <[email protected]> Cc: Stanislaw Gruszka <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Andrew Morton <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'net/tipc/handler.c')
0 files changed, 0 insertions, 0 deletions