From: Peter Zijlstra <peterz@infradead.org>
To: Eric Paris <eparis@redhat.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, efault@gmx.de
Subject: [PATCH] sched: Revert 738d2be, Simplify set_task_cpu()
Date: Tue, 22 Dec 2009 15:43:19 +0100 [thread overview]
Message-ID: <1261492999.4937.36.camel@laptop> (raw)
In-Reply-To: <1261463382.2923.1.camel@localhost>
[ 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 <eparis@redhat.com>
Tested-by: Eric Paris <eparis@redhat.com>,
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
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);
}
next prev parent reply other threads:[~2009-12-22 14:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-22 0:17 2.6.33-rc1 unusable due to scheduler issues, circular locking, WARNs and BUGs Eric Paris
2009-12-22 5:42 ` Xiaotian Feng
2009-12-22 7:19 ` Américo Wang
2009-12-22 7:41 ` Xiaotian Feng
2009-12-22 7:50 ` Américo Wang
2009-12-22 8:34 ` Xiaotian Feng
2009-12-22 8:48 ` Peter Zijlstra
2009-12-22 6:29 ` Eric Paris
2009-12-22 14:41 ` [PATCH] sched: Peter Zijlstra
2009-12-22 14:43 ` Peter Zijlstra [this message]
2009-12-23 9:06 ` [tip:sched/urgent] sched: Revert 738d2be, simplify set_task_cpu() tip-bot for Peter Zijlstra
2009-12-22 11:31 ` 2.6.33-rc1 unusable due to scheduler issues, circular locking, WARNs and BUGs Arjan van de Ven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1261492999.4937.36.camel@laptop \
--to=peterz@infradead.org \
--cc=efault@gmx.de \
--cc=eparis@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.