aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2009-12-22 09:43:19 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-23 04:04:10 -0500
commit0c69774e6ce94364cfaa8bdeb18061edc414bc5a (patch)
treeb83fdb55af2f9b9dddcab4a273739ebe1c810594 /kernel
parentf7b84a6ba7eaeba4e1df8feddca1473a7db369a5 (diff)
sched: Revert 738d2be, simplify set_task_cpu()
Effectively reverts 738d2be4301007f054541c5c4bf7fb6a361c9b3a. As demonstrated by Eric, we really need to call __set_task_cpu() early in the fork() path to properly initialize the various task state -- specifically the cgroup state through set_task_rq(). [ we could probably fix this by explicitly calling __set_task_cpu() from sched_fork(), but lets try that for the next cycle and simply revert to the old behaviour for now. ] Reported-by: Eric Paris <eparis@redhat.com> Tested-by: Eric Paris <eparis@redhat.com>, Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: efault@gmx.de LKML-Reference: <1261492999.4937.36.camel@laptop> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 87f1f47beffe..c535cc4f6428 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2045,11 +2045,10 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
2045 2045
2046 trace_sched_migrate_task(p, new_cpu); 2046 trace_sched_migrate_task(p, new_cpu);
2047 2047
2048 if (task_cpu(p) == new_cpu) 2048 if (task_cpu(p) != new_cpu) {
2049 return; 2049 p->se.nr_migrations++;
2050 2050 perf_sw_event(PERF_COUNT_SW_CPU_MIGRATIONS, 1, 1, NULL, 0);
2051 p->se.nr_migrations++; 2051 }
2052 perf_sw_event(PERF_COUNT_SW_CPU_MIGRATIONS, 1, 1, NULL, 0);
2053 2052
2054 __set_task_cpu(p, new_cpu); 2053 __set_task_cpu(p, new_cpu);
2055} 2054}