aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2012-11-27 13:33:25 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-11-30 14:40:07 -0500
commit91d1aa43d30505b0b825db8898ffc80a8eca96c7 (patch)
tree911636f846d800c8a44efd540842dc726ec7c191 /kernel/sched
parent4e79752c25ec221ac1e28f8875b539ed7631a0db (diff)
context_tracking: New context tracking susbsystem
Create a new subsystem that probes on kernel boundaries to keep track of the transitions between level contexts with two basic initial contexts: user or kernel. This is an abstraction of some RCU code that use such tracking to implement its userspace extended quiescent state. We need to pull this up from RCU into this new level of indirection because this tracking is also going to be used to implement an "on demand" generic virtual cputime accounting. A necessary step to shutdown the tick while still accounting the cputime. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Li Zhong <zhong@linux.vnet.ibm.com> Cc: Gilad Ben-Yossef <gilad@benyossef.com> Reviewed-by: Steven Rostedt <rostedt@goodmis.org> [ paulmck: fix whitespace error and email address. ] Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 36f260864f65..80f80dfca70e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -72,6 +72,7 @@
72#include <linux/slab.h> 72#include <linux/slab.h>
73#include <linux/init_task.h> 73#include <linux/init_task.h>
74#include <linux/binfmts.h> 74#include <linux/binfmts.h>
75#include <linux/context_tracking.h>
75 76
76#include <asm/switch_to.h> 77#include <asm/switch_to.h>
77#include <asm/tlb.h> 78#include <asm/tlb.h>
@@ -1886,8 +1887,8 @@ context_switch(struct rq *rq, struct task_struct *prev,
1886 spin_release(&rq->lock.dep_map, 1, _THIS_IP_); 1887 spin_release(&rq->lock.dep_map, 1, _THIS_IP_);
1887#endif 1888#endif
1888 1889
1890 context_tracking_task_switch(prev, next);
1889 /* Here we just switch the register state and the stack. */ 1891 /* Here we just switch the register state and the stack. */
1890 rcu_user_hooks_switch(prev, next);
1891 switch_to(prev, next, prev); 1892 switch_to(prev, next, prev);
1892 1893
1893 barrier(); 1894 barrier();
@@ -2911,7 +2912,7 @@ asmlinkage void __sched schedule(void)
2911} 2912}
2912EXPORT_SYMBOL(schedule); 2913EXPORT_SYMBOL(schedule);
2913 2914
2914#ifdef CONFIG_RCU_USER_QS 2915#ifdef CONFIG_CONTEXT_TRACKING
2915asmlinkage void __sched schedule_user(void) 2916asmlinkage void __sched schedule_user(void)
2916{ 2917{
2917 /* 2918 /*
@@ -2920,9 +2921,9 @@ asmlinkage void __sched schedule_user(void)
2920 * we haven't yet exited the RCU idle mode. Do it here manually until 2921 * we haven't yet exited the RCU idle mode. Do it here manually until
2921 * we find a better solution. 2922 * we find a better solution.
2922 */ 2923 */
2923 rcu_user_exit(); 2924 user_exit();
2924 schedule(); 2925 schedule();
2925 rcu_user_enter(); 2926 user_enter();
2926} 2927}
2927#endif 2928#endif
2928 2929
@@ -3027,7 +3028,7 @@ asmlinkage void __sched preempt_schedule_irq(void)
3027 /* Catch callers which need to be fixed */ 3028 /* Catch callers which need to be fixed */
3028 BUG_ON(ti->preempt_count || !irqs_disabled()); 3029 BUG_ON(ti->preempt_count || !irqs_disabled());
3029 3030
3030 rcu_user_exit(); 3031 user_exit();
3031 do { 3032 do {
3032 add_preempt_count(PREEMPT_ACTIVE); 3033 add_preempt_count(PREEMPT_ACTIVE);
3033 local_irq_enable(); 3034 local_irq_enable();