Skip to content

Commit

Permalink
x86-64: Inline vdso clock_gettime helpers
Browse files Browse the repository at this point in the history
This is about a 3% speedup on Sandy Bridge.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: John Stultz <john.stultz@linaro.org>
  • Loading branch information
Andy Lutomirski authored and John Stultz committed Mar 23, 2012
1 parent 91ec87d commit 5f29347
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arch/x86/vdso/vclock_gettime.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ notrace static inline long vgetns(void)
return (v * gtod->clock.mult) >> gtod->clock.shift;
}

notrace static noinline int do_realtime(struct timespec *ts)
/* Code size doesn't matter (vdso is 4k anyway) and this is faster. */
notrace static int __always_inline do_realtime(struct timespec *ts)
{
unsigned long seq, ns;
int mode;
Expand All @@ -111,7 +112,7 @@ notrace static noinline int do_realtime(struct timespec *ts)
return mode;
}

notrace static noinline int do_monotonic(struct timespec *ts)
notrace static int do_monotonic(struct timespec *ts)
{
unsigned long seq, ns;
int mode;
Expand All @@ -128,7 +129,7 @@ notrace static noinline int do_monotonic(struct timespec *ts)
return mode;
}

notrace static noinline int do_realtime_coarse(struct timespec *ts)
notrace static int do_realtime_coarse(struct timespec *ts)
{
unsigned long seq;
do {
Expand All @@ -139,7 +140,7 @@ notrace static noinline int do_realtime_coarse(struct timespec *ts)
return 0;
}

notrace static noinline int do_monotonic_coarse(struct timespec *ts)
notrace static int do_monotonic_coarse(struct timespec *ts)
{
unsigned long seq;
do {
Expand Down

0 comments on commit 5f29347

Please sign in to comment.