From: tip-bot for Byungchul Park <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, mingo@kernel.org, efault@gmx.de,
tglx@linutronix.de, torvalds@linux-foundation.org,
linux-kernel@vger.kernel.org, peterz@infradead.org,
byungchul.park@lge.com
Subject: [tip:sched/core] sched/fair: Modify the comment about lock assumptions in migrate_task_rq_fair()
Date: Mon, 23 Nov 2015 08:24:11 -0800 [thread overview]
Message-ID: <tip-525628c73bd6af65f27d927e699e7460d7d55ed3@git.kernel.org> (raw)
In-Reply-To: <1447806899-20303-1-git-send-email-byungchul.park@lge.com>
Commit-ID: 525628c73bd6af65f27d927e699e7460d7d55ed3
Gitweb: http://git.kernel.org/tip/525628c73bd6af65f27d927e699e7460d7d55ed3
Author: Byungchul Park <byungchul.park@lge.com>
AuthorDate: Wed, 18 Nov 2015 09:34:59 +0900
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 23 Nov 2015 09:48:20 +0100
sched/fair: Modify the comment about lock assumptions in migrate_task_rq_fair()
The comment describing migrate_task_rq_fair() says that the caller
should hold p->pi_lock. But in some cases the caller can hold
task_rq(p)->lock instead of p->pi_lock. So the comment is broken and
this patch fixes it.
Signed-off-by: Byungchul Park <byungchul.park@lge.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1447806899-20303-1-git-send-email-byungchul.park@lge.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f7017ad..ff8ec86 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5058,8 +5058,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f
/*
* Called immediately before a task is migrated to a new cpu; task_cpu(p) and
* cfs_rq_of(p) references at time of call are still valid and identify the
- * previous cpu. However, the caller only guarantees p->pi_lock is held; no
- * other assumptions, including the state of rq->lock, should be made.
+ * previous cpu. The caller guarantees p->pi_lock or task_rq(p)->lock is held.
*/
static void migrate_task_rq_fair(struct task_struct *p)
{
prev parent reply other threads:[~2015-11-23 16:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-18 0:34 [PATCH] sched: modify the comment about lock assumption " byungchul.park
2015-11-23 16:24 ` tip-bot for Byungchul Park [this message]
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-525628c73bd6af65f27d927e699e7460d7d55ed3@git.kernel.org \
--to=tipbot@zytor.com \
--cc=byungchul.park@lge.com \
--cc=efault@gmx.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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
all inboxes | Powered by JetHome®