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

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

+24 -9
+1
arch/x86/kernel/traps_32.c
··· 541 541 info.si_errno = 0; \ 542 542 info.si_code = sicode; \ 543 543 info.si_addr = (void __user *)siaddr; \ 544 + trace_hardirqs_fixup(); \ 544 545 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ 545 546 == NOTIFY_STOP) \ 546 547 return; \
+1
arch/x86/kernel/traps_64.c
··· 635 635 info.si_errno = 0; \ 636 636 info.si_code = sicode; \ 637 637 info.si_addr = (void __user *)siaddr; \ 638 + trace_hardirqs_fixup(); \ 638 639 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ 639 640 == NOTIFY_STOP) \ 640 641 return; \
+11 -3
include/linux/workqueue.h
··· 149 149 150 150 extern struct workqueue_struct * 151 151 __create_workqueue_key(const char *name, int singlethread, 152 - int freezeable, struct lock_class_key *key); 152 + int freezeable, struct lock_class_key *key, 153 + const char *lock_name); 153 154 154 155 #ifdef CONFIG_LOCKDEP 155 156 #define __create_workqueue(name, singlethread, freezeable) \ 156 157 ({ \ 157 158 static struct lock_class_key __key; \ 159 + const char *__lock_name; \ 160 + \ 161 + if (__builtin_constant_p(name)) \ 162 + __lock_name = (name); \ 163 + else \ 164 + __lock_name = #name; \ 158 165 \ 159 166 __create_workqueue_key((name), (singlethread), \ 160 - (freezeable), &__key); \ 167 + (freezeable), &__key, \ 168 + __lock_name); \ 161 169 }) 162 170 #else 163 171 #define __create_workqueue(name, singlethread, freezeable) \ 164 - __create_workqueue_key((name), (singlethread), (freezeable), NULL) 172 + __create_workqueue_key((name), (singlethread), (freezeable), NULL, NULL) 165 173 #endif 166 174 167 175 #define create_workqueue(name) __create_workqueue((name), 0, 0)
+8 -4
kernel/lockdep.c
··· 2943 2943 struct list_head *head; 2944 2944 unsigned long flags; 2945 2945 int i; 2946 + int locked; 2946 2947 2947 2948 raw_local_irq_save(flags); 2948 - graph_lock(); 2949 + locked = graph_lock(); 2949 2950 2950 2951 /* 2951 2952 * Unhash all classes that were created by this module: ··· 2960 2959 zap_class(class); 2961 2960 } 2962 2961 2963 - graph_unlock(); 2962 + if (locked) 2963 + graph_unlock(); 2964 2964 raw_local_irq_restore(flags); 2965 2965 } 2966 2966 ··· 2971 2969 struct list_head *head; 2972 2970 unsigned long flags; 2973 2971 int i, j; 2972 + int locked; 2974 2973 2975 2974 raw_local_irq_save(flags); 2976 2975 ··· 2990 2987 * Debug check: in the end all mapped classes should 2991 2988 * be gone. 2992 2989 */ 2993 - graph_lock(); 2990 + locked = graph_lock(); 2994 2991 for (i = 0; i < CLASSHASH_SIZE; i++) { 2995 2992 head = classhash_table + i; 2996 2993 if (list_empty(head)) ··· 3003 3000 } 3004 3001 } 3005 3002 } 3006 - graph_unlock(); 3003 + if (locked) 3004 + graph_unlock(); 3007 3005 3008 3006 out_restore: 3009 3007 raw_local_irq_restore(flags);
+3 -2
kernel/workqueue.c
··· 722 722 struct workqueue_struct *__create_workqueue_key(const char *name, 723 723 int singlethread, 724 724 int freezeable, 725 - struct lock_class_key *key) 725 + struct lock_class_key *key, 726 + const char *lock_name) 726 727 { 727 728 struct workqueue_struct *wq; 728 729 struct cpu_workqueue_struct *cwq; ··· 740 739 } 741 740 742 741 wq->name = name; 743 - lockdep_init_map(&wq->lockdep_map, name, key, 0); 742 + lockdep_init_map(&wq->lockdep_map, lock_name, key, 0); 744 743 wq->singlethread = singlethread; 745 744 wq->freezeable = freezeable; 746 745 INIT_LIST_HEAD(&wq->list);