mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched: modify the comment about lock assumption in migrate_task_rq_fair()
@ 2015-11-18  0:34 byungchul.park
  2015-11-23 16:24 ` [tip:sched/core] sched/fair: Modify the comment about lock assumptions " tip-bot for Byungchul Park
  0 siblings, 1 reply; 2+ messages in thread
From: byungchul.park @ 2015-11-18  0:34 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel, efault, tglx, yuyang.du, pjt, Byungchul Park

From: Byungchul Park <byungchul.park@lge.com>

The comment describing migrate_task_rq_fair() says that the caller
should hold p->pi_lock. But in some other case, the caller can hold
task_rq(p)->lock instead of p->pi_lock. So the comment is broken and
this patch fixs it.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
---
 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 077076f..6f43dfd 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5006,8 +5006,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, int next_cpu)
 {
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-23 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18  0:34 [PATCH] sched: modify the comment about lock assumption in migrate_task_rq_fair() byungchul.park
2015-11-23 16:24 ` [tip:sched/core] sched/fair: Modify the comment about lock assumptions " tip-bot for Byungchul Park

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®