aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2011-04-05 11:23:42 -0400
committerIngo Molnar <mingo@elte.hu>2011-04-14 02:52:34 -0400
commit893633817f5b58f5227365d74344e0170a718213 (patch)
tree32270e47d1c60b2a60a3318cc9e1113f05963c3d /kernel/sched.c
parentc2f7115e2e52a6c187b8c1f54f0e4970bb677be0 (diff)
sched: Change the ttwu() success details
try_to_wake_up() would only return a success when it would have to place a task on a rq, change that to every time we change p->state to TASK_RUNNING, because that's the real measure of wakeups. This results in that success is always true for the tracepoints. Reviewed-by: Frank Rowand <frank.rowand@am.sony.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Nick Piggin <npiggin@kernel.dk> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/20110405152728.866866929@chello.nl
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 81ab58efd788..3919aa419356 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2427,10 +2427,10 @@ static inline void ttwu_activate(struct task_struct *p, struct rq *rq,
2427 wq_worker_waking_up(p, cpu_of(rq)); 2427 wq_worker_waking_up(p, cpu_of(rq));
2428} 2428}
2429 2429
2430static inline void ttwu_post_activation(struct task_struct *p, struct rq *rq, 2430static void
2431 int wake_flags, bool success) 2431ttwu_post_activation(struct task_struct *p, struct rq *rq, int wake_flags)
2432{ 2432{
2433 trace_sched_wakeup(p, success); 2433 trace_sched_wakeup(p, true);
2434 check_preempt_curr(rq, p, wake_flags); 2434 check_preempt_curr(rq, p, wake_flags);
2435 2435
2436 p->state = TASK_RUNNING; 2436 p->state = TASK_RUNNING;
@@ -2546,9 +2546,9 @@ out_activate:
2546#endif /* CONFIG_SMP */ 2546#endif /* CONFIG_SMP */
2547 ttwu_activate(p, rq, wake_flags & WF_SYNC, orig_cpu != cpu, 2547 ttwu_activate(p, rq, wake_flags & WF_SYNC, orig_cpu != cpu,
2548 cpu == this_cpu, en_flags); 2548 cpu == this_cpu, en_flags);
2549 success = 1;
2550out_running: 2549out_running:
2551 ttwu_post_activation(p, rq, wake_flags, success); 2550 ttwu_post_activation(p, rq, wake_flags);
2551 success = 1;
2552out: 2552out:
2553 task_rq_unlock(rq, &flags); 2553 task_rq_unlock(rq, &flags);
2554 put_cpu(); 2554 put_cpu();
@@ -2567,7 +2567,6 @@ out:
2567static void try_to_wake_up_local(struct task_struct *p) 2567static void try_to_wake_up_local(struct task_struct *p)
2568{ 2568{
2569 struct rq *rq = task_rq(p); 2569 struct rq *rq = task_rq(p);
2570 bool success = false;
2571 2570
2572 BUG_ON(rq != this_rq()); 2571 BUG_ON(rq != this_rq());
2573 BUG_ON(p == current); 2572 BUG_ON(p == current);
@@ -2582,9 +2581,8 @@ static void try_to_wake_up_local(struct task_struct *p)
2582 schedstat_inc(rq, ttwu_local); 2581 schedstat_inc(rq, ttwu_local);
2583 } 2582 }
2584 ttwu_activate(p, rq, false, false, true, ENQUEUE_WAKEUP); 2583 ttwu_activate(p, rq, false, false, true, ENQUEUE_WAKEUP);
2585 success = true;
2586 } 2584 }
2587 ttwu_post_activation(p, rq, 0, success); 2585 ttwu_post_activation(p, rq, 0);
2588} 2586}
2589 2587
2590/** 2588/**
@@ -2747,7 +2745,7 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
2747 2745
2748 rq = task_rq_lock(p, &flags); 2746 rq = task_rq_lock(p, &flags);
2749 activate_task(rq, p, 0); 2747 activate_task(rq, p, 0);
2750 trace_sched_wakeup_new(p, 1); 2748 trace_sched_wakeup_new(p, true);
2751 check_preempt_curr(rq, p, WF_FORK); 2749 check_preempt_curr(rq, p, WF_FORK);
2752#ifdef CONFIG_SMP 2750#ifdef CONFIG_SMP
2753 if (p->sched_class->task_woken) 2751 if (p->sched_class->task_woken)