diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2013-07-11 19:42:13 +0200 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2013-08-14 17:14:47 +0200 |
commit | 73d424f9af7b571276e6284617cb59726d47bf12 (patch) | |
tree | 6ee47dd0327e67c8514ebfefc12728b030e79ae5 /include/linux/context_tracking.h | |
parent | 48d6a816a8bf36e2a197c322697323003bdc1cfe (diff) | |
download | linux-73d424f9af7b571276e6284617cb59726d47bf12.tar.gz linux-73d424f9af7b571276e6284617cb59726d47bf12.tar.bz2 linux-73d424f9af7b571276e6284617cb59726d47bf12.zip |
context_tracking: Optimize context switch off case with static keys
No need for syscall slowpath if no CPU is full dynticks,
rather nop this in this case.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Kevin Hilman <khilman@linaro.org>
Diffstat (limited to 'include/linux/context_tracking.h')
-rw-r--r-- | include/linux/context_tracking.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index 8854eadb2142..e070ea5dadac 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h @@ -40,6 +40,8 @@ extern void context_tracking_cpu_set(int cpu); extern void context_tracking_user_enter(void); extern void context_tracking_user_exit(void); +extern void __context_tracking_task_switch(struct task_struct *prev, + struct task_struct *next); static inline void user_enter(void) { @@ -74,8 +76,12 @@ static inline void exception_exit(enum ctx_state prev_ctx) } } -extern void context_tracking_task_switch(struct task_struct *prev, - struct task_struct *next); +static inline void context_tracking_task_switch(struct task_struct *prev, + struct task_struct *next) +{ + if (static_key_false(&context_tracking_enabled)) + __context_tracking_task_switch(prev, next); +} #else static inline bool context_tracking_in_user(void) { return false; } static inline void user_enter(void) { } @@ -112,6 +118,7 @@ static inline void guest_exit(void) else current->flags &= ~PF_VCPU; } + #else static inline void guest_enter(void) { |