Commit d8c89eb3 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'v2.6.24-rc7-lockdep' of...

Merge branch 'v2.6.24-rc7-lockdep' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep

* 'v2.6.24-rc7-lockdep' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep:
  lockdep: more hardirq annotations for notify_die()
  lockdep: fix workqueue creation API lockdep interaction
  lockdep: fix internal double unlock during self-test
parents 456ef155 fb1dac90
...@@ -541,6 +541,7 @@ fastcall void do_##name(struct pt_regs * regs, long error_code) \ ...@@ -541,6 +541,7 @@ fastcall void do_##name(struct pt_regs * regs, long error_code) \
info.si_errno = 0; \ info.si_errno = 0; \
info.si_code = sicode; \ info.si_code = sicode; \
info.si_addr = (void __user *)siaddr; \ info.si_addr = (void __user *)siaddr; \
trace_hardirqs_fixup(); \
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
== NOTIFY_STOP) \ == NOTIFY_STOP) \
return; \ return; \
......
...@@ -635,6 +635,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ ...@@ -635,6 +635,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
info.si_errno = 0; \ info.si_errno = 0; \
info.si_code = sicode; \ info.si_code = sicode; \
info.si_addr = (void __user *)siaddr; \ info.si_addr = (void __user *)siaddr; \
trace_hardirqs_fixup(); \
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
== NOTIFY_STOP) \ == NOTIFY_STOP) \
return; \ return; \
......
...@@ -149,19 +149,27 @@ struct execute_work { ...@@ -149,19 +149,27 @@ struct execute_work {
extern struct workqueue_struct * extern struct workqueue_struct *
__create_workqueue_key(const char *name, int singlethread, __create_workqueue_key(const char *name, int singlethread,
int freezeable, struct lock_class_key *key); int freezeable, struct lock_class_key *key,
const char *lock_name);
#ifdef CONFIG_LOCKDEP #ifdef CONFIG_LOCKDEP
#define __create_workqueue(name, singlethread, freezeable) \ #define __create_workqueue(name, singlethread, freezeable) \
({ \ ({ \
static struct lock_class_key __key; \ static struct lock_class_key __key; \
const char *__lock_name; \
\
if (__builtin_constant_p(name)) \
__lock_name = (name); \
else \
__lock_name = #name; \
\ \
__create_workqueue_key((name), (singlethread), \ __create_workqueue_key((name), (singlethread), \
(freezeable), &__key); \ (freezeable), &__key, \
__lock_name); \
}) })
#else #else
#define __create_workqueue(name, singlethread, freezeable) \ #define __create_workqueue(name, singlethread, freezeable) \
__create_workqueue_key((name), (singlethread), (freezeable), NULL) __create_workqueue_key((name), (singlethread), (freezeable), NULL, NULL)
#endif #endif
#define create_workqueue(name) __create_workqueue((name), 0, 0) #define create_workqueue(name) __create_workqueue((name), 0, 0)
......
...@@ -2943,9 +2943,10 @@ void lockdep_free_key_range(void *start, unsigned long size) ...@@ -2943,9 +2943,10 @@ void lockdep_free_key_range(void *start, unsigned long size)
struct list_head *head; struct list_head *head;
unsigned long flags; unsigned long flags;
int i; int i;
int locked;
raw_local_irq_save(flags); raw_local_irq_save(flags);
graph_lock(); locked = graph_lock();
/* /*
* Unhash all classes that were created by this module: * Unhash all classes that were created by this module:
...@@ -2959,7 +2960,8 @@ void lockdep_free_key_range(void *start, unsigned long size) ...@@ -2959,7 +2960,8 @@ void lockdep_free_key_range(void *start, unsigned long size)
zap_class(class); zap_class(class);
} }
graph_unlock(); if (locked)
graph_unlock();
raw_local_irq_restore(flags); raw_local_irq_restore(flags);
} }
...@@ -2969,6 +2971,7 @@ void lockdep_reset_lock(struct lockdep_map *lock) ...@@ -2969,6 +2971,7 @@ void lockdep_reset_lock(struct lockdep_map *lock)
struct list_head *head; struct list_head *head;
unsigned long flags; unsigned long flags;
int i, j; int i, j;
int locked;
raw_local_irq_save(flags); raw_local_irq_save(flags);
...@@ -2987,7 +2990,7 @@ void lockdep_reset_lock(struct lockdep_map *lock) ...@@ -2987,7 +2990,7 @@ void lockdep_reset_lock(struct lockdep_map *lock)
* Debug check: in the end all mapped classes should * Debug check: in the end all mapped classes should
* be gone. * be gone.
*/ */
graph_lock(); locked = graph_lock();
for (i = 0; i < CLASSHASH_SIZE; i++) { for (i = 0; i < CLASSHASH_SIZE; i++) {
head = classhash_table + i; head = classhash_table + i;
if (list_empty(head)) if (list_empty(head))
...@@ -3000,7 +3003,8 @@ void lockdep_reset_lock(struct lockdep_map *lock) ...@@ -3000,7 +3003,8 @@ void lockdep_reset_lock(struct lockdep_map *lock)
} }
} }
} }
graph_unlock(); if (locked)
graph_unlock();
out_restore: out_restore:
raw_local_irq_restore(flags); raw_local_irq_restore(flags);
......
...@@ -722,7 +722,8 @@ static void start_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu) ...@@ -722,7 +722,8 @@ static void start_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu)
struct workqueue_struct *__create_workqueue_key(const char *name, struct workqueue_struct *__create_workqueue_key(const char *name,
int singlethread, int singlethread,
int freezeable, int freezeable,
struct lock_class_key *key) struct lock_class_key *key,
const char *lock_name)
{ {
struct workqueue_struct *wq; struct workqueue_struct *wq;
struct cpu_workqueue_struct *cwq; struct cpu_workqueue_struct *cwq;
...@@ -739,7 +740,7 @@ struct workqueue_struct *__create_workqueue_key(const char *name, ...@@ -739,7 +740,7 @@ struct workqueue_struct *__create_workqueue_key(const char *name,
} }
wq->name = name; wq->name = name;
lockdep_init_map(&wq->lockdep_map, name, key, 0); lockdep_init_map(&wq->lockdep_map, lock_name, key, 0);
wq->singlethread = singlethread; wq->singlethread = singlethread;
wq->freezeable = freezeable; wq->freezeable = freezeable;
INIT_LIST_HEAD(&wq->list); INIT_LIST_HEAD(&wq->list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment