]> git.baikalelectronics.ru Git - kernel.git/commit
sched/clock: Make local_clock()/cpu_clock() inline
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 11 Apr 2016 14:38:34 +0000 (16:38 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 13 Apr 2016 10:25:22 +0000 (12:25 +0200)
commite67ce85e16e5f9837b779e6a6f7df509b758603a
tree138907178baed5ae0f6be39fb1204fa5e285818d
parentc9d46288d79dc049765878e2a8163b1fa9254b9b
sched/clock: Make local_clock()/cpu_clock() inline

The local_clock/cpu_clock functions were changed to prevent a double
identical test with sched_clock_cpu() when HAVE_UNSTABLE_SCHED_CLOCK
is set. That resulted in one line functions.

As these functions are in all the cases one line functions and in the
hot path, it is useful to specify them as static inline in order to
give a strong hint to the compiler.

After verification, it appears the compiler does not inline them
without this hint. Change those functions to static inline.

sched_clock_cpu() is called via the inlined local_clock()/cpu_clock()
functions from sched.h. So any module code including sched.h will
reference sched_clock_cpu(). Thus it must be exported with the
EXPORT_SYMBOL_GPL macro.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1460385514-14700-2-git-send-email-daniel.lezcano@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/sched.h
kernel/sched/clock.c