From: tip-bot for Peter Zijlstra <peterz@infradead.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
a.p.zijlstra@chello.nl, eparis@redhat.com, peterz@infradead.org,
tglx@linutronix.de, mingo@elte.hu
Subject: [tip:sched/urgent] sched: Revert 738d2be, simplify set_task_cpu()
Date: Wed, 23 Dec 2009 09:06:36 GMT [thread overview]
Message-ID: <tip-0c69774e6ce94364cfaa8bdeb18061edc414bc5a@git.kernel.org> (raw)
In-Reply-To: <1261492999.4937.36.camel@laptop>
Commit-ID: 0c69774e6ce94364cfaa8bdeb18061edc414bc5a
Gitweb: http://git.kernel.org/tip/0c69774e6ce94364cfaa8bdeb18061edc414bc5a
Author: Peter Zijlstra <peterz@infradead.org>
AuthorDate: Tue, 22 Dec 2009 15:43:19 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 23 Dec 2009 10:04:10 +0100
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>
---
kernel/sched.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 87f1f47..c535cc4 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)
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-23 9:07 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 ` [PATCH] sched: Revert 738d2be, Simplify set_task_cpu() Peter Zijlstra
2009-12-23 9:06 ` tip-bot for Peter Zijlstra [this message]
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=tip-0c69774e6ce94364cfaa8bdeb18061edc414bc5a@git.kernel.org \
--to=peterz@infradead.org \
--cc=a.p.zijlstra@chello.nl \
--cc=eparis@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox