Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "lockdep: check that no locks held at freeze time"

This reverts commit 6aa9707099c4b25700940eb3d016f16c4434360d.

Commit 6aa9707099c4 ("lockdep: check that no locks held at freeze time")
causes problems with NFS root filesystems. The failures were noticed on
OMAP2 and 3 boards during kernel init:

[ BUG: swapper/0/1 still has locks held! ]
3.9.0-rc3-00344-ga937536 #1 Not tainted
-------------------------------------
1 lock held by swapper/0/1:
#0: (&type->s_umount_key#13/1){+.+.+.}, at: [<c011e84c>] sget+0x248/0x574

stack backtrace:
rpc_wait_bit_killable
__wait_on_bit
out_of_line_wait_on_bit
__rpc_execute
rpc_run_task
rpc_call_sync
nfs_proc_get_root
nfs_get_root
nfs_fs_mount_common
nfs_try_mount
nfs_fs_mount
mount_fs
vfs_kern_mount
do_mount
sys_mount
do_mount_root
mount_root
prepare_namespace
kernel_init_freeable
kernel_init

Although the rootfs mounts, the system is unstable. Here's a transcript
from a PM test:

http://www.pwsan.com/omap/testlogs/test_v3.9-rc3/20130317194234/pm/37xxevm/37xxevm_log.txt

Here's what the test log should look like:

http://www.pwsan.com/omap/testlogs/test_v3.8/20130218214403/pm/37xxevm/37xxevm_log.txt

Mailing list discussion is here:

http://lkml.org/lkml/2013/3/4/221

Deal with this for v3.9 by reverting the problem commit, until folks can
figure out the right long-term course of action.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Mandeep Singh Baines <msb@chromium.org>
Cc: Jeff Layton <jlayton@redhat.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: <maciej.rutecki@gmail.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ben Chan <benchan@chromium.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Paul Walmsley and committed by
Linus Torvalds
dbf520a9 13d2080d

+12 -14
+2 -2
include/linux/debug_locks.h
··· 51 51 extern void debug_show_all_locks(void); 52 52 extern void debug_show_held_locks(struct task_struct *task); 53 53 extern void debug_check_no_locks_freed(const void *from, unsigned long len); 54 - extern void debug_check_no_locks_held(void); 54 + extern void debug_check_no_locks_held(struct task_struct *task); 55 55 #else 56 56 static inline void debug_show_all_locks(void) 57 57 { ··· 67 67 } 68 68 69 69 static inline void 70 - debug_check_no_locks_held(void) 70 + debug_check_no_locks_held(struct task_struct *task) 71 71 { 72 72 } 73 73 #endif
-3
include/linux/freezer.h
··· 3 3 #ifndef FREEZER_H_INCLUDED 4 4 #define FREEZER_H_INCLUDED 5 5 6 - #include <linux/debug_locks.h> 7 6 #include <linux/sched.h> 8 7 #include <linux/wait.h> 9 8 #include <linux/atomic.h> ··· 48 49 49 50 static inline bool try_to_freeze(void) 50 51 { 51 - if (!(current->flags & PF_NOFREEZE)) 52 - debug_check_no_locks_held(); 53 52 might_sleep(); 54 53 if (likely(!freezing(current))) 55 54 return false;
+1 -1
kernel/exit.c
··· 835 835 /* 836 836 * Make sure we are holding no locks: 837 837 */ 838 - debug_check_no_locks_held(); 838 + debug_check_no_locks_held(tsk); 839 839 /* 840 840 * We can do this unlocked here. The futex code uses this flag 841 841 * just to verify whether the pi state cleanup has been done
+9 -8
kernel/lockdep.c
··· 4088 4088 } 4089 4089 EXPORT_SYMBOL_GPL(debug_check_no_locks_freed); 4090 4090 4091 - static void print_held_locks_bug(void) 4091 + static void print_held_locks_bug(struct task_struct *curr) 4092 4092 { 4093 4093 if (!debug_locks_off()) 4094 4094 return; ··· 4097 4097 4098 4098 printk("\n"); 4099 4099 printk("=====================================\n"); 4100 - printk("[ BUG: %s/%d still has locks held! ]\n", 4101 - current->comm, task_pid_nr(current)); 4100 + printk("[ BUG: lock held at task exit time! ]\n"); 4102 4101 print_kernel_ident(); 4103 4102 printk("-------------------------------------\n"); 4104 - lockdep_print_held_locks(current); 4103 + printk("%s/%d is exiting with locks still held!\n", 4104 + curr->comm, task_pid_nr(curr)); 4105 + lockdep_print_held_locks(curr); 4106 + 4105 4107 printk("\nstack backtrace:\n"); 4106 4108 dump_stack(); 4107 4109 } 4108 4110 4109 - void debug_check_no_locks_held(void) 4111 + void debug_check_no_locks_held(struct task_struct *task) 4110 4112 { 4111 - if (unlikely(current->lockdep_depth > 0)) 4112 - print_held_locks_bug(); 4113 + if (unlikely(task->lockdep_depth > 0)) 4114 + print_held_locks_bug(task); 4113 4115 } 4114 - EXPORT_SYMBOL_GPL(debug_check_no_locks_held); 4115 4116 4116 4117 void debug_show_all_locks(void) 4117 4118 {