From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751814AbdJDVak (ORCPT ); Wed, 4 Oct 2017 17:30:40 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49260 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751969AbdJDV3n (ORCPT ); Wed, 4 Oct 2017 17:29:43 -0400 From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 7/9] rcu: Pretend ->boost_mtx acquired legitimately Date: Wed, 4 Oct 2017 14:29:33 -0700 X-Mailer: git-send-email 2.5.2 In-Reply-To: <20171004212915.GA10089@linux.vnet.ibm.com> References: <20171004212915.GA10089@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17100421-0048-0000-0000-000001EFE257 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007843; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000233; SDB=6.00926533; UDB=6.00466100; IPR=6.00706745; BA=6.00005620; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017394; XFM=3.00000015; UTC=2017-10-04 21:29:41 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17100421-0049-0000-0000-000042C47140 Message-Id: <1507152575-11055-7-git-send-email-paulmck@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-04_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710040299 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RCU priority boosting uses rt_mutex_init_proxy_locked() to initialize an rt_mutex structure in locked state held by some other task. When that other task releases it, lockdep complains (quite accurately, but a bit uselessly) that the other task never acquired it. This complaint can suppress other, more helpful, lockdep complaints, and in any case it is a false positive. This commit therefore uses the mutex_acquire() macro to make it look like that other process legitimately acquired the lock, thus suppressing this lockdep false-positive complaint. Of course, if lockdep ever learns about rt_mutex_init_proxy_locked(), this commit will need to be reverted. Signed-off-by: Paul E. McKenney --- kernel/rcu/tree_plugin.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index fed95fa941e6..60bfb16c9a1a 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -529,8 +529,11 @@ void rcu_read_unlock_special(struct task_struct *t) } /* Unboost if we were boosted. */ - if (IS_ENABLED(CONFIG_RCU_BOOST) && drop_boost_mutex) + if (IS_ENABLED(CONFIG_RCU_BOOST) && drop_boost_mutex) { + /* For lockdep, pretend we acquired lock honestly. */ + mutex_acquire(&rnp->boost_mtx.dep_map, 0, 0, _RET_IP_); rt_mutex_unlock(&rnp->boost_mtx); + } /* * If this was the last task on the expedited lists, -- 2.5.2