@@ -1129,10 +1129,11 @@ print_circular_bug_header(struct lock_list *entry, unsigned int depth,
11291129 if (debug_locks_silent )
11301130 return 0 ;
11311131
1132- printk ("\n=======================================================\n" );
1133- printk ( "[ INFO: possible circular locking dependency detected ]\n" );
1132+ printk ("\n" );
1133+ printk ("======================================================\n" );
1134+ printk ("[ INFO: possible circular locking dependency detected ]\n" );
11341135 print_kernel_version ();
1135- printk ( "-------------------------------------------------------\n" );
1136+ printk ("-------------------------------------------------------\n" );
11361137 printk ("%s/%d is trying to acquire lock:\n" ,
11371138 curr -> comm , task_pid_nr (curr ));
11381139 print_lock (check_src );
@@ -1463,11 +1464,12 @@ print_bad_irq_dependency(struct task_struct *curr,
14631464 if (!debug_locks_off_graph_unlock () || debug_locks_silent )
14641465 return 0 ;
14651466
1466- printk ("\n======================================================\n" );
1467- printk ( "[ INFO: %s-safe -> %s-unsafe lock order detected ]\n" ,
1467+ printk ("\n" );
1468+ printk ("======================================================\n" );
1469+ printk ("[ INFO: %s-safe -> %s-unsafe lock order detected ]\n" ,
14681470 irqclass , irqclass );
14691471 print_kernel_version ();
1470- printk ( "------------------------------------------------------\n" );
1472+ printk ("------------------------------------------------------\n" );
14711473 printk ("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] is trying to acquire:\n" ,
14721474 curr -> comm , task_pid_nr (curr ),
14731475 curr -> hardirq_context , hardirq_count () >> HARDIRQ_SHIFT ,
@@ -1692,10 +1694,11 @@ print_deadlock_bug(struct task_struct *curr, struct held_lock *prev,
16921694 if (!debug_locks_off_graph_unlock () || debug_locks_silent )
16931695 return 0 ;
16941696
1695- printk ("\n=============================================\n" );
1696- printk ( "[ INFO: possible recursive locking detected ]\n" );
1697+ printk ("\n" );
1698+ printk ("=============================================\n" );
1699+ printk ("[ INFO: possible recursive locking detected ]\n" );
16971700 print_kernel_version ();
1698- printk ( "---------------------------------------------\n" );
1701+ printk ("---------------------------------------------\n" );
16991702 printk ("%s/%d is trying to acquire lock:\n" ,
17001703 curr -> comm , task_pid_nr (curr ));
17011704 print_lock (next );
@@ -2177,10 +2180,11 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this,
21772180 if (!debug_locks_off_graph_unlock () || debug_locks_silent )
21782181 return 0 ;
21792182
2180- printk ("\n=================================\n" );
2181- printk ( "[ INFO: inconsistent lock state ]\n" );
2183+ printk ("\n" );
2184+ printk ("=================================\n" );
2185+ printk ("[ INFO: inconsistent lock state ]\n" );
21822186 print_kernel_version ();
2183- printk ( "---------------------------------\n" );
2187+ printk ("---------------------------------\n" );
21842188
21852189 printk ("inconsistent {%s} -> {%s} usage.\n" ,
21862190 usage_str [prev_bit ], usage_str [new_bit ]);
@@ -2241,10 +2245,11 @@ print_irq_inversion_bug(struct task_struct *curr,
22412245 if (!debug_locks_off_graph_unlock () || debug_locks_silent )
22422246 return 0 ;
22432247
2244- printk ("\n=========================================================\n" );
2245- printk ( "[ INFO: possible irq lock inversion dependency detected ]\n" );
2248+ printk ("\n" );
2249+ printk ("=========================================================\n" );
2250+ printk ("[ INFO: possible irq lock inversion dependency detected ]\n" );
22462251 print_kernel_version ();
2247- printk ( "---------------------------------------------------------\n" );
2252+ printk ("---------------------------------------------------------\n" );
22482253 printk ("%s/%d just changed the state of lock:\n" ,
22492254 curr -> comm , task_pid_nr (curr ));
22502255 print_lock (this );
@@ -3065,9 +3070,10 @@ print_unlock_inbalance_bug(struct task_struct *curr, struct lockdep_map *lock,
30653070 if (debug_locks_silent )
30663071 return 0 ;
30673072
3068- printk ("\n=====================================\n" );
3069- printk ( "[ BUG: bad unlock balance detected! ]\n" );
3070- printk ( "-------------------------------------\n" );
3073+ printk ("\n" );
3074+ printk ("=====================================\n" );
3075+ printk ("[ BUG: bad unlock balance detected! ]\n" );
3076+ printk ("-------------------------------------\n" );
30713077 printk ("%s/%d is trying to release lock (" ,
30723078 curr -> comm , task_pid_nr (curr ));
30733079 print_lockdep_cache (lock );
@@ -3478,9 +3484,10 @@ print_lock_contention_bug(struct task_struct *curr, struct lockdep_map *lock,
34783484 if (debug_locks_silent )
34793485 return 0 ;
34803486
3481- printk ("\n=================================\n" );
3482- printk ( "[ BUG: bad contention detected! ]\n" );
3483- printk ( "---------------------------------\n" );
3487+ printk ("\n" );
3488+ printk ("=================================\n" );
3489+ printk ("[ BUG: bad contention detected! ]\n" );
3490+ printk ("---------------------------------\n" );
34843491 printk ("%s/%d is trying to contend lock (" ,
34853492 curr -> comm , task_pid_nr (curr ));
34863493 print_lockdep_cache (lock );
@@ -3839,9 +3846,10 @@ print_freed_lock_bug(struct task_struct *curr, const void *mem_from,
38393846 if (debug_locks_silent )
38403847 return ;
38413848
3842- printk ("\n=========================\n" );
3843- printk ( "[ BUG: held lock freed! ]\n" );
3844- printk ( "-------------------------\n" );
3849+ printk ("\n" );
3850+ printk ("=========================\n" );
3851+ printk ("[ BUG: held lock freed! ]\n" );
3852+ printk ("-------------------------\n" );
38453853 printk ("%s/%d is freeing memory %p-%p, with a lock still held there!\n" ,
38463854 curr -> comm , task_pid_nr (curr ), mem_from , mem_to - 1 );
38473855 print_lock (hlock );
@@ -3895,9 +3903,10 @@ static void print_held_locks_bug(struct task_struct *curr)
38953903 if (debug_locks_silent )
38963904 return ;
38973905
3898- printk ("\n=====================================\n" );
3899- printk ( "[ BUG: lock held at task exit time! ]\n" );
3900- printk ( "-------------------------------------\n" );
3906+ printk ("\n" );
3907+ printk ("=====================================\n" );
3908+ printk ("[ BUG: lock held at task exit time! ]\n" );
3909+ printk ("-------------------------------------\n" );
39013910 printk ("%s/%d is exiting with locks still held!\n" ,
39023911 curr -> comm , task_pid_nr (curr ));
39033912 lockdep_print_held_locks (curr );
@@ -3991,16 +4000,17 @@ void lockdep_sys_exit(void)
39914000 if (unlikely (curr -> lockdep_depth )) {
39924001 if (!debug_locks_off ())
39934002 return ;
3994- printk ("\n================================================\n" );
3995- printk ( "[ BUG: lock held when returning to user space! ]\n" );
3996- printk ( "------------------------------------------------\n" );
4003+ printk ("\n" );
4004+ printk ("================================================\n" );
4005+ printk ("[ BUG: lock held when returning to user space! ]\n" );
4006+ printk ("------------------------------------------------\n" );
39974007 printk ("%s/%d is leaving the kernel with locks still held!\n" ,
39984008 curr -> comm , curr -> pid );
39994009 lockdep_print_held_locks (curr );
40004010 }
40014011}
40024012
4003- void lockdep_rcu_dereference (const char * file , const int line )
4013+ void lockdep_rcu_suspicious (const char * file , const int line , const char * s )
40044014{
40054015 struct task_struct * curr = current ;
40064016
@@ -4009,15 +4019,15 @@ void lockdep_rcu_dereference(const char *file, const int line)
40094019 return ;
40104020#endif /* #ifdef CONFIG_PROVE_RCU_REPEATEDLY */
40114021 /* Note: the following can be executed concurrently, so be careful. */
4012- printk ("\n===================================================\n " );
4013- printk ( "[ INFO: suspicious rcu_dereference_check() usage. ] \n" );
4014- printk ( "--------------------------------------------------- \n" );
4015- printk ("%s:%d invoked rcu_dereference_check() without protection! \n" ,
4016- file , line );
4022+ printk ("\n" );
4023+ printk ("=============================== \n" );
4024+ printk ("[ INFO: suspicious RCU usage. ] \n" );
4025+ printk ("------------------------------- \n" );
4026+ printk ( "%s:%d %s!\n" , file , line , s );
40174027 printk ("\nother info that might help us debug this:\n\n" );
40184028 printk ("\nrcu_scheduler_active = %d, debug_locks = %d\n" , rcu_scheduler_active , debug_locks );
40194029 lockdep_print_held_locks (curr );
40204030 printk ("\nstack backtrace:\n" );
40214031 dump_stack ();
40224032}
4023- EXPORT_SYMBOL_GPL (lockdep_rcu_dereference );
4033+ EXPORT_SYMBOL_GPL (lockdep_rcu_suspicious );
0 commit comments