Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182243
b: refs/heads/master
c: 0632eb3
h: refs/heads/master
i:
  182241: dbcb8e2
  182239: d7b7cd3
v: v3
  • Loading branch information
Paul E. McKenney authored and Ingo Molnar committed Feb 25, 2010
1 parent 74c5197 commit db91cf8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c26d34a5858f96a564c45048bf5f09319d2abad1
refs/heads/master: 0632eb3d7563d6a76d49a3860b6352d800c92854
4 changes: 4 additions & 0 deletions trunk/include/linux/lockdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,4 +534,8 @@ do { \
# define might_lock_read(lock) do { } while (0)
#endif

#ifdef CONFIG_PROVE_RCU
extern void lockdep_rcu_dereference(const char *file, const int line);
#endif

#endif /* __LINUX_LOCKDEP_H */
4 changes: 2 additions & 2 deletions trunk/include/linux/rcupdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ static inline int rcu_read_lock_sched_held(void)
*/
#define rcu_dereference_check(p, c) \
({ \
if (debug_locks) \
WARN_ON_ONCE(!(c)); \
if (debug_locks && !(c)) \
lockdep_rcu_dereference(__FILE__, __LINE__); \
rcu_dereference_raw(p); \
})

Expand Down
18 changes: 18 additions & 0 deletions trunk/kernel/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -3809,3 +3809,21 @@ void lockdep_sys_exit(void)
lockdep_print_held_locks(curr);
}
}

void lockdep_rcu_dereference(const char *file, const int line)
{
struct task_struct *curr = current;

if (!debug_locks_off())
return;
printk("\n==============================================\n");
printk( "[ BUG: Unsafe rcu_dereference_check() usage! ]\n");
printk( "----------------------------------------------\n");
printk("%s:%d invoked rcu_dereference_check() without protection!\n",
file, line);
printk("\nother info that might help us debug this:\n\n");
lockdep_print_held_locks(curr);
printk("\nstack backtrace:\n");
dump_stack();
}
EXPORT_SYMBOL_GPL(lockdep_rcu_dereference);

0 comments on commit db91cf8

Please sign in to comment.