From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753551AbdFROGd (ORCPT ); Sun, 18 Jun 2017 10:06:33 -0400 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:56947 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753044AbdFROG3 (ORCPT ); Sun, 18 Jun 2017 10:06:29 -0400 X-IronPort-Anti-Spam-Filtered: false From: "Levin, Alexander (Sasha Levin)" Cc: "Levin, Alexander (Sasha Levin)" , "Linus Torvalds" , Thomas Gleixner , Ingo Molnar , "linux-kernel@vger.kernel.org" X-IronPort-AV: E=Sophos;i="5.39,316,1493683200"; d="scan'208";a="220653142" To: "peterz@infradead.org" Subject: [PATCH] rt_mutex: don't initialize lockdep when not required Thread-Topic: [PATCH] rt_mutex: don't initialize lockdep when not required Thread-Index: AQHS6DwEN/ySzQlzG0adwRc+gbd9Zg== Date: Sun, 18 Jun 2017 14:06:01 +0000 Message-ID: <20170618140548.4763-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v5IE6oVJ006375 pi_mutex isn't supposed to be tracked by lockdep, but just passing NULLs for name and key will cause lockdep to spew a warning and die, which is not what we want it to do. Skip lockdep initialization if the caller passed NULLs for name and key, suggesting such initialization isn't desired. Fixes: f5694788ad8d ("rt_mutex: Add lockdep annotations") Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: linux-kernel@vger.kernel.org Signed-off-by: Sasha Levin --- kernel/locking/rtmutex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index 43123533e9b1..78069895032a 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -1661,7 +1661,8 @@ void __rt_mutex_init(struct rt_mutex *lock, const char *name, lock->waiters = RB_ROOT; lock->waiters_leftmost = NULL; - debug_rt_mutex_init(lock, name, key); + if (name && key) + debug_rt_mutex_init(lock, name, key); } EXPORT_SYMBOL_GPL(__rt_mutex_init); -- 2.11.0