Commit b84cb5df authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

sched: Remove rq argument from ttwu_stat()

In order to call ttwu_stat() without holding rq->lock we must remove
its rq argument. Since we need to change rq stats, account to the
local rq instead of the task rq, this is safe since we have IRQs
disabled.
Reviewed-by: default avatarFrank 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: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20110405152729.394638826@chello.nl
parent e4a52bcb
...@@ -2410,9 +2410,11 @@ static void update_avg(u64 *avg, u64 sample) ...@@ -2410,9 +2410,11 @@ static void update_avg(u64 *avg, u64 sample)
#endif #endif
static void static void
ttwu_stat(struct rq *rq, struct task_struct *p, int cpu, int wake_flags) ttwu_stat(struct task_struct *p, int cpu, int wake_flags)
{ {
#ifdef CONFIG_SCHEDSTATS #ifdef CONFIG_SCHEDSTATS
struct rq *rq = this_rq();
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
int this_cpu = smp_processor_id(); int this_cpu = smp_processor_id();
...@@ -2561,9 +2563,10 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) ...@@ -2561,9 +2563,10 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
ttwu_activate(rq, p, ENQUEUE_WAKEUP | ENQUEUE_WAKING); ttwu_activate(rq, p, ENQUEUE_WAKEUP | ENQUEUE_WAKING);
out_running: out_running:
ttwu_post_activation(p, rq, wake_flags); ttwu_post_activation(p, rq, wake_flags);
ttwu_stat(rq, p, cpu, wake_flags);
success = 1; success = 1;
__task_rq_unlock(rq); __task_rq_unlock(rq);
ttwu_stat(p, cpu, wake_flags);
out: out:
raw_spin_unlock_irqrestore(&p->pi_lock, flags); raw_spin_unlock_irqrestore(&p->pi_lock, flags);
put_cpu(); put_cpu();
...@@ -2600,7 +2603,7 @@ static void try_to_wake_up_local(struct task_struct *p) ...@@ -2600,7 +2603,7 @@ static void try_to_wake_up_local(struct task_struct *p)
ttwu_activate(rq, p, ENQUEUE_WAKEUP); ttwu_activate(rq, p, ENQUEUE_WAKEUP);
ttwu_post_activation(p, rq, 0); ttwu_post_activation(p, rq, 0);
ttwu_stat(rq, p, smp_processor_id(), 0); ttwu_stat(p, smp_processor_id(), 0);
out: out:
raw_spin_unlock(&p->pi_lock); raw_spin_unlock(&p->pi_lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment