From patchwork Tue Jul 30 11:24:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11065639 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7C92112C for ; Tue, 30 Jul 2019 12:08:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C864928784 for ; Tue, 30 Jul 2019 12:08:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC2C3287CB; Tue, 30 Jul 2019 12:08:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61A6428784 for ; Tue, 30 Jul 2019 12:08:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729214AbfG3MHw (ORCPT ); Tue, 30 Jul 2019 08:07:52 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:56554 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727206AbfG3MHu (ORCPT ); Tue, 30 Jul 2019 08:07:50 -0400 Received: from localhost ([127.0.0.1] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1hsQuL-0006QF-SX; Tue, 30 Jul 2019 14:07:09 +0200 Message-Id: <20190730120321.193069837@linutronix.de> User-Agent: quilt/0.65 Date: Tue, 30 Jul 2019 13:24:53 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Ingo Molnar , Sebastian Siewior , Anna-Maria Gleixner , Steven Rostedt , Julia Cartwright , "Theodore Tso" , Matthew Wilcox , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, Jan Kara Subject: [patch 1/4] locking/lockdep: Add Kconfig option for bit spinlocks References: <20190730112452.871257694@linutronix.de> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some usage sites of bit spinlocks have a substitution with regular spinlocks which depends on CONFIG_PREEMPT_RT. But this substitution can also be used to expose these locks to the regular lock debugging infrastructure, e.g. lockdep. As this increases the size of affected data structures significantly this is guarded by a separate Kconfig switch. Note, that only the bit spinlocks which have a substitution implemented will be covered by this. All other bit spinlocks evade lock debugging as before. Signed-off-by: Thomas Gleixner --- lib/Kconfig.debug | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1201,6 +1201,16 @@ config DEBUG_RWSEMS This debugging feature allows mismatched rw semaphore locks and unlocks to be detected and reported. +config DEBUG_BIT_SPINLOCKS + bool "Bit spinlock debugging" + depends on DEBUG_SPINLOCK + help + This debugging feature substitutes bit spinlocks in some use + cases, e.g. buffer head, zram, with with regular spinlocks so + these locks are exposed to lock debugging features. + + Not all bit spinlocks are covered by this. + config DEBUG_LOCK_ALLOC bool "Lock debugging: detect incorrect freeing of live locks" depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT