The patch titled Subject: lockdep: check that no locks held at freeze time has been added to the -mm tree. Its filename is lockdep-check-that-no-locks-held-at-freeze-time.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Mandeep Singh Baines <msb@xxxxxxxxxxxx> Subject: lockdep: check that no locks held at freeze time We shouldn't try_to_freeze if locks are held. Verified that I get no lockdep warnings after applying this patch and "vfork: don't freezer_count() for in-kernel users of CLONE_VFORK". Signed-off-by: Mandeep Singh Baines <msb@xxxxxxxxxxxx> Cc: Ben Chan <benchan@xxxxxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Cc: Rafael J. Wysocki <rjw@xxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/freezer.h | 2 ++ kernel/lockdep.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff -puN include/linux/freezer.h~lockdep-check-that-no-locks-held-at-freeze-time include/linux/freezer.h --- a/include/linux/freezer.h~lockdep-check-that-no-locks-held-at-freeze-time +++ a/include/linux/freezer.h @@ -3,6 +3,7 @@ #ifndef FREEZER_H_INCLUDED #define FREEZER_H_INCLUDED +#include <linux/debug_locks.h> #include <linux/sched.h> #include <linux/wait.h> #include <linux/atomic.h> @@ -48,6 +49,7 @@ extern void thaw_kernel_threads(void); static inline bool try_to_freeze(void) { + debug_check_no_locks_held(current); might_sleep(); if (likely(!freezing(current))) return false; diff -puN kernel/lockdep.c~lockdep-check-that-no-locks-held-at-freeze-time kernel/lockdep.c --- a/kernel/lockdep.c~lockdep-check-that-no-locks-held-at-freeze-time +++ a/kernel/lockdep.c @@ -4098,10 +4098,10 @@ static void print_held_locks_bug(struct return; printk("\n"); - printk("=====================================\n"); - printk("[ BUG: lock held at task exit time! ]\n"); + printk("=======================================\n"); + printk("[ BUG: lock held at exit/freeze time! ]\n"); print_kernel_ident(); - printk("-------------------------------------\n"); + printk("---------------------------------------\n"); printk("%s/%d is exiting with locks still held!\n", curr->comm, task_pid_nr(curr)); lockdep_print_held_locks(curr); _ Patches currently in -mm which might be from msb@xxxxxxxxxxxx are vfork-dont-freezer_count-for-in-kernel-users-of-clone_vfork.patch lockdep-check-that-no-locks-held-at-freeze-time.patch coredump-cleanup-the-waiting-for-coredump_finish-code.patch coredump-use-a-freezable_schedule-for-the-coredump_finish-wait.patch coredump-abort-core-dump-piping-only-due-to-a-fatal-signal.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html