[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1362529819-19076-1-git-send-email-msb@chromium.org>
Date: Tue, 5 Mar 2013 16:30:19 -0800
From: Mandeep Singh Baines <msb@...omium.org>
To: linux-kernel@...r.kernel.org, linux-nfs@...r.kernel.org
Cc: Mandeep Singh Baines <msb@...omium.org>, Tejun Heo <tj@...nel.org>,
Jeff Layton <jlayton@...hat.com>,
"Myklebust, Trond" <Trond.Myklebust@...app.com>,
Oleg Nesterov <oleg@...hat.com>,
Ming Lei <ming.lei@...onical.com>,
"Rafael J. Wysocki" <rjw@...k.pl>,
Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...hat.com>
Subject: [PATCH] lockdep: make lock held while freezing check optional
This check is turning up a lot of code paths which need to be
fixed so while those paths are fixed, let's make this check
optional so that folks can still use lockdep.
CC: Tejun Heo <tj@...nel.org>
CC: Jeff Layton <jlayton@...hat.com>
CC: "Myklebust, Trond" <Trond.Myklebust@...app.com>
CC: Oleg Nesterov <oleg@...hat.com>
CC: Ming Lei <ming.lei@...onical.com>
CC: "Rafael J. Wysocki" <rjw@...k.pl>
CC: Andrew Morton <akpm@...ux-foundation.org>
CC: Ingo Molnar <mingo@...hat.com>
---
include/linux/freezer.h | 2 ++
lib/Kconfig.debug | 12 ++++++++++++
2 files changed, 14 insertions(+)
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 043a5cf..03bdc54 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -49,8 +49,10 @@ extern void thaw_kernel_threads(void);
static inline bool try_to_freeze(void)
{
+#ifdef CONFIG_DEBUG_LOCK_HELD_FREEZING
if (!(current->flags & PF_NOFREEZE))
debug_check_no_locks_held();
+#endif
might_sleep();
if (likely(!freezing(current)))
return false;
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 28be08c..bddda5f 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -547,6 +547,18 @@ config DEBUG_MUTEXES
This feature allows mutex semantics violations to be detected and
reported.
+config DEBUG_LOCK_HELD_FREEZING
+ bool "Lock debugging: detect when locks are held during freeze"
+ depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
+ select DEBUG_SPINLOCK
+ select DEBUG_MUTEXES
+ select LOCKDEP
+ help
+ This feature will check whether any lock is incorrectly held
+ while freezing. If a task freezes with a lock held it will
+ block any other task that is waiting on that lock from freezing.
+ In the case of cgroup_freezer, this can cause a deadlock.
+
config DEBUG_LOCK_ALLOC
bool "Lock debugging: detect incorrect freeing of live locks"
depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
--
1.7.12.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists