linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Byungchul Park <byungchul.park@lge.com>
Cc: Theodore Ts'o <tytso@mit.edu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	kernel-team@lge.com, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, oleg@redhat.com, tj@kernel.org
Subject: [PATCH] locking/lockdep: Add CONFIG_LOCKDEP_AGGRESSIVE
Date: Sun, 10 Dec 2017 22:50:17 -0500	[thread overview]
Message-ID: <20171211035017.32678-1-tytso@mit.edu> (raw)

CONFIG_LOCKDEP_CROSSRELEASE and CONFIG_LOCKDEP_COMPLETIONS can result
in a large number of false positives because lockdep doesn't
understand how to deal with multiple stacked loop or MD devices.

Until someone can figure out how to automatically add annotations to
all file system and storage devices --- hopefully without forcing
developers to insert a large number of calls to undocumented lockdep
macros into the the loop device, every single file system, and every
single device-mapper backend --- let's add an option to allow these
lockdep features to be disabled.  Otherwise, many file system
developers will disable LOCKDEP entirely since it results in far too
many false positives when trying to use xfstests.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Byungchul Park <byungchul.park@lge.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kernel-team@lge.com
Cc: linux-block@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org
Cc: oleg@redhat.com
Cc: tj@kernel.org
---
 lib/Kconfig.debug | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 947d3e2ed5c2..acae7ba99c16 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1099,8 +1099,8 @@ config PROVE_LOCKING
 	select DEBUG_MUTEXES
 	select DEBUG_RT_MUTEXES if RT_MUTEXES
 	select DEBUG_LOCK_ALLOC
-	select LOCKDEP_CROSSRELEASE
-	select LOCKDEP_COMPLETIONS
+	select LOCKDEP_CROSSRELEASE if LOCKDEP_AGGRESSIVE
+	select LOCKDEP_COMPLETIONS if LOCKDEP_AGGRESSIVE
 	select TRACE_IRQFLAGS
 	default n
 	help
@@ -1137,6 +1137,16 @@ config PROVE_LOCKING
 
 	 For more details, see Documentation/locking/lockdep-design.txt.
 
+config LOCKDEP_AGGRESSIVE
+	bool "Lock debugging: use aggressive techniques"
+	default n
+	help
+	 This enables some extremely aggressive lockdep checking that
+	 may result in false positives.
+
+	 Say N here if you are planning on using xfstests and don't
+	 want to deal with many false positive test failures.
+
 config LOCKDEP
 	bool
 	depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
-- 
2.11.0.rc0.7.gbe5a750

             reply	other threads:[~2017-12-11  3:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11  3:50 Theodore Ts'o [this message]
2017-12-11  3:57 ` [PATCH] locking/lockdep: Add CONFIG_LOCKDEP_AGGRESSIVE Theodore Ts'o
2017-12-11 21:06 ` Linus Torvalds
2017-12-12  1:56   ` Theodore Ts'o
2017-12-12  5:20   ` Byungchul Park
2017-12-12 13:03     ` Theodore Ts'o
2017-12-12 15:39       ` Matthew Wilcox
2017-12-13  5:33       ` Byungchul Park
2017-12-12 17:00     ` Linus Torvalds
2017-12-13  5:38       ` Byungchul Park

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171211035017.32678-1-tytso@mit.edu \
    --to=tytso@mit.edu \
    --cc=byungchul.park@lge.com \
    --cc=kernel-team@lge.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).