From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754440AbbKRAfQ (ORCPT ); Tue, 17 Nov 2015 19:35:16 -0500 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:43587 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752225AbbKRAfO (ORCPT ); Tue, 17 Nov 2015 19:35:14 -0500 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 165.244.98.76 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com From: To: , CC: linux-kernel@vger.kernel.org, efault@gmx.de, tglx@linutronix.de, yuyang.du@intel.com, pjt@google.com, Byungchul Park Subject: [PATCH] sched: modify the comment about lock assumption in migrate_task_rq_fair() Date: Wed, 18 Nov 2015 09:34:59 +0900 Message-ID: <1447806899-20303-1-git-send-email-byungchul.park@lge.com> X-Mailer: git-send-email 1.7.9.5 X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB02/LGE/LG Group(Release 8.5.3FP3HF583 | August 9, 2013) at 2015/11/18 09:35:10, Serialize by Router on LGEKRMHUB02/LGE/LG Group(Release 8.5.3FP3HF583 | August 9, 2013) at 2015/11/18 09:35:10, Serialize complete at 2015/11/18 09:35:10 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Byungchul Park 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 --- 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