[patch 2/4] BFS 420: fix ttwu_stat

From: Hillf Danton
Date: Fri May 25 2012 - 09:34:38 EST


The last parameter, wake_flags, as not used, is replaced by the result that the
sleeper is activated successfully or not. If not, only to increase ttwu counter.

--- a/kernel/sched/bfs.c Mon May 14 20:50:38 2012
+++ b/kernel/sched/bfs.c Fri May 25 20:28:00 2012
@@ -1486,7 +1486,7 @@ static void try_preempt(struct task_stru
#endif /* CONFIG_SMP */

static void
-ttwu_stat(struct task_struct *p, int cpu, int wake_flags)
+ttwu_stat(struct task_struct *p, int cpu, bool success)
{
#ifdef CONFIG_SCHEDSTATS
struct rq *rq = this_rq();
@@ -1494,6 +1494,8 @@ ttwu_stat(struct task_struct *p, int cpu
#ifdef CONFIG_SMP
int this_cpu = smp_processor_id();

+ if (!success)
+ goto out;
if (cpu == this_cpu)
schedstat_inc(rq, ttwu_local);
else {
@@ -1508,7 +1510,7 @@ ttwu_stat(struct task_struct *p, int cpu
}
rcu_read_unlock();
}
-
+out:
#endif /* CONFIG_SMP */

schedstat_inc(rq, ttwu_count);
@@ -1603,7 +1605,7 @@ out_running:
out_unlock:
task_grq_unlock(&flags);

- ttwu_stat(p, cpu, wake_flags);
+ ttwu_stat(p, cpu, success);

put_cpu();

@@ -1634,7 +1636,7 @@ static void try_to_wake_up_local(struct
schedstat_inc(rq, ttwu_local);
}
ttwu_activate(p, rq, false);
- ttwu_stat(p, smp_processor_id(), 0);
+ ttwu_stat(p, smp_processor_id(), true);
success = true;
}
ttwu_post_activation(p, rq, success);
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/