Skip to content

Commit

Permalink
speed up jiffies conversion functions if HZ==USER_HZ
Browse files Browse the repository at this point in the history
Avoid calling do_div(x, 1) in this case.

Cc: David Fries <david@fries.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Feb 6, 2008
1 parent 6ffc787 commit ec03d70
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,10 @@ u64 jiffies_64_to_clock_t(u64 x)
# if HZ < USER_HZ
x *= USER_HZ;
do_div(x, HZ);
# else
# elif HZ > USER_HZ
do_div(x, HZ / USER_HZ);
# else
/* Nothing to do */
# endif
#else
/*
Expand Down

0 comments on commit ec03d70

Please sign in to comment.