diff options
author | Andy Lutomirski <luto@MIT.EDU> | 2011-05-23 09:31:27 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-05-24 14:51:28 +0200 |
commit | 0f51f2852ccf0fe38a02d340d0ba625e8e32a863 (patch) | |
tree | 075e1f7c85c4deec2e0ab7509dcafa859842abd9 /arch/x86/kernel/tsc.c | |
parent | 3729db5ca2b2000c660e5a5d0eb68b1053212cab (diff) | |
download | op-kernel-dev-0f51f2852ccf0fe38a02d340d0ba625e8e32a863.zip op-kernel-dev-0f51f2852ccf0fe38a02d340d0ba625e8e32a863.tar.gz |
x86-64: Vclock_gettime(CLOCK_MONOTONIC) can't ever see nsec < 0
vclock_gettime's do_monotonic helper can't ever generate a negative
nsec value, so it doesn't need to check whether it's negative. In
the CLOCK_MONOTONIC_COARSE case, ns can't ever exceed 2e9-1, so we
can avoid the loop entirely. This saves a single easily-predicted
branch.
Signed-off-by: Andy Lutomirski <luto@mit.edu>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Borislav Petkov <bp@amd64.org>
Link: http://lkml.kernel.org/r/%3Cd6d528d32c7a21618057cfc9005942a0fe5cb54a.1306156808.git.luto%40mit.edu%3E
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/tsc.c')
0 files changed, 0 insertions, 0 deletions