Rev 1408 | Rev 1970 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1408 | Rev 1964 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | #define XXX_LOCK_USAGE_STATES (1+3*4) |
26 | #define XXX_LOCK_USAGE_STATES (1+3*4) |
Line 27... | Line 27... | ||
27 | 27 | ||
Line 28... | Line 28... | ||
28 | #define MAX_LOCKDEP_SUBCLASSES 8UL |
28 | #define MAX_LOCKDEP_SUBCLASSES 8UL |
- | 29 | ||
- | 30 | /* |
|
- | 31 | * NR_LOCKDEP_CACHING_CLASSES ... Number of classes |
|
- | 32 | * cached in the instance of lockdep_map |
|
- | 33 | * |
|
- | 34 | * Currently main class (subclass == 0) and signle depth subclass |
|
- | 35 | * are cached in lockdep_map. This optimization is mainly targeting |
|
- | 36 | * on rq->lock. double_rq_lock() acquires this highly competitive with |
|
- | 37 | * single depth. |
|
- | 38 | */ |
|
- | 39 | #define NR_LOCKDEP_CACHING_CLASSES 2 |
|
29 | 40 | ||
30 | /* |
41 | /* |
31 | * Lock-classes are keyed via unique addresses, by embedding the |
42 | * Lock-classes are keyed via unique addresses, by embedding the |
32 | * lockclass-key into the kernel (or module) .data section. (For |
43 | * lockclass-key into the kernel (or module) .data section. (For |
33 | * static locks we use the lock address itself as the key.) |
44 | * static locks we use the lock address itself as the key.) |
Line 130... | Line 141... | ||
130 | * Map the lock object (the lock instance) to the lock-class object. |
141 | * Map the lock object (the lock instance) to the lock-class object. |
131 | * This is embedded into specific lock instances: |
142 | * This is embedded into specific lock instances: |
132 | */ |
143 | */ |
133 | struct lockdep_map { |
144 | struct lockdep_map { |
134 | struct lock_class_key *key; |
145 | struct lock_class_key *key; |
135 | struct lock_class *class_cache; |
146 | struct lock_class *class_cache[NR_LOCKDEP_CACHING_CLASSES]; |
136 | const char *name; |
147 | const char *name; |
137 | #ifdef CONFIG_LOCK_STAT |
148 | #ifdef CONFIG_LOCK_STAT |
138 | int cpu; |
149 | int cpu; |
139 | unsigned long ip; |
150 | unsigned long ip; |
140 | #endif |
151 | #endif |
Line 264... | Line 275... | ||
264 | #define lockdep_set_class_and_subclass(lock, key, sub) \ |
275 | #define lockdep_set_class_and_subclass(lock, key, sub) \ |
265 | lockdep_init_map(&(lock)->dep_map, #key, key, sub) |
276 | lockdep_init_map(&(lock)->dep_map, #key, key, sub) |
266 | #define lockdep_set_subclass(lock, sub) \ |
277 | #define lockdep_set_subclass(lock, sub) \ |
267 | lockdep_init_map(&(lock)->dep_map, #lock, \ |
278 | lockdep_init_map(&(lock)->dep_map, #lock, \ |
268 | (lock)->dep_map.key, sub) |
279 | (lock)->dep_map.key, sub) |
- | 280 | ||
- | 281 | #define lockdep_set_novalidate_class(lock) \ |
|
- | 282 | lockdep_set_class(lock, &__lockdep_no_validate__) |
|
269 | /* |
283 | /* |
270 | * Compare locking classes |
284 | * Compare locking classes |
271 | */ |
285 | */ |
272 | #define lockdep_match_class(lock, key) lockdep_match_key(&(lock)->dep_map, key) |
286 | #define lockdep_match_class(lock, key) lockdep_match_key(&(lock)->dep_map, key) |
Line 348... | Line 362... | ||
348 | # define lockdep_set_class_and_name(lock, key, name) \ |
362 | # define lockdep_set_class_and_name(lock, key, name) \ |
349 | do { (void)(key); (void)(name); } while (0) |
363 | do { (void)(key); (void)(name); } while (0) |
350 | #define lockdep_set_class_and_subclass(lock, key, sub) \ |
364 | #define lockdep_set_class_and_subclass(lock, key, sub) \ |
351 | do { (void)(key); } while (0) |
365 | do { (void)(key); } while (0) |
352 | #define lockdep_set_subclass(lock, sub) do { } while (0) |
366 | #define lockdep_set_subclass(lock, sub) do { } while (0) |
- | 367 | ||
- | 368 | #define lockdep_set_novalidate_class(lock) do { } while (0) |
|
- | 369 | ||
353 | /* |
370 | /* |
354 | * We don't define lockdep_match_class() and lockdep_match_key() for !LOCKDEP |
371 | * We don't define lockdep_match_class() and lockdep_match_key() for !LOCKDEP |
355 | * case since the result is not well defined and the caller should rather |
372 | * case since the result is not well defined and the caller should rather |
356 | * #ifdef the call himself. |
373 | * #ifdef the call himself. |
357 | */ |
374 | */ |
Line 410... | Line 427... | ||
410 | #define LOCK_CONTENDED_FLAGS(_lock, try, lock, lockfl, flags) \ |
427 | #define LOCK_CONTENDED_FLAGS(_lock, try, lock, lockfl, flags) \ |
411 | lockfl((_lock), (flags)) |
428 | lockfl((_lock), (flags)) |
Line 412... | Line 429... | ||
412 | 429 | ||
Line 413... | Line -... | ||
413 | #endif /* CONFIG_LOCKDEP */ |
- | |
414 | - | ||
415 | #ifdef CONFIG_GENERIC_HARDIRQS |
- | |
416 | extern void early_init_irq_lock_class(void); |
- | |
417 | #else |
- | |
418 | static inline void early_init_irq_lock_class(void) |
- | |
419 | { |
- | |
420 | } |
- | |
421 | #endif |
430 | #endif /* CONFIG_LOCKDEP */ |
422 | 431 | ||
423 | #ifdef CONFIG_TRACE_IRQFLAGS |
432 | #ifdef CONFIG_TRACE_IRQFLAGS |
424 | extern void early_boot_irqs_off(void); |
433 | extern void early_boot_irqs_off(void); |
425 | extern void early_boot_irqs_on(void); |
434 | extern void early_boot_irqs_on(void); |
Line 532... | Line 541... | ||
532 | #else |
541 | #else |
533 | # define might_lock(lock) do { } while (0) |
542 | # define might_lock(lock) do { } while (0) |
534 | # define might_lock_read(lock) do { } while (0) |
543 | # define might_lock_read(lock) do { } while (0) |
535 | #endif |
544 | #endif |
Line -... | Line 545... | ||
- | 545 | ||
- | 546 | #ifdef CONFIG_PROVE_RCU |
|
- | 547 | extern void lockdep_rcu_dereference(const char *file, const int line); |
|
- | 548 | #endif |
|
536 | 549 |