Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753398AbZLVOn7 (ORCPT ); Tue, 22 Dec 2009 09:43:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752849AbZLVOn6 (ORCPT ); Tue, 22 Dec 2009 09:43:58 -0500 Received: from casper.infradead.org ([85.118.1.10]:56448 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752155AbZLVOn6 (ORCPT ); Tue, 22 Dec 2009 09:43:58 -0500 Subject: [PATCH] sched: Revert 738d2be, Simplify set_task_cpu() From: Peter Zijlstra To: Eric Paris Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, efault@gmx.de In-Reply-To: <1261463382.2923.1.camel@localhost> References: <1261441037.3273.254.camel@localhost> <1261471720.4937.9.camel@laptop> <1261463382.2923.1.camel@localhost> Content-Type: text/plain; charset="UTF-8" Date: Tue, 22 Dec 2009 15:43:19 +0100 Message-ID: <1261492999.4937.36.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1501 Lines: 47 [ and now with Subject ] 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 Tested-by: Eric Paris , Signed-off-by: Peter Zijlstra --- kernel/sched.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) Index: linux-2.6/kernel/sched.c =================================================================== --- linux-2.6.orig/kernel/sched.c +++ linux-2.6/kernel/sched.c @@ -2067,11 +2067,10 @@ void set_task_cpu(struct task_struct *p, trace_sched_migrate_task(p, new_cpu); - if (task_cpu(p) == new_cpu) - return; - - p->se.nr_migrations++; - perf_sw_event(PERF_COUNT_SW_CPU_MIGRATIONS, 1, 1, NULL, 0); + if (task_cpu(p) != new_cpu) { + p->se.nr_migrations++; + perf_sw_event(PERF_COUNT_SW_CPU_MIGRATIONS, 1, 1, NULL, 0); + } __set_task_cpu(p, new_cpu); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/