aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/lockdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r--kernel/lockdep.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 977f940fd562..32f944752b18 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -450,12 +450,12 @@ static const char *usage_str[] =
450 [LOCK_USED] = "initial-use ", 450 [LOCK_USED] = "initial-use ",
451 [LOCK_USED_IN_HARDIRQ] = "in-hardirq-W", 451 [LOCK_USED_IN_HARDIRQ] = "in-hardirq-W",
452 [LOCK_USED_IN_SOFTIRQ] = "in-softirq-W", 452 [LOCK_USED_IN_SOFTIRQ] = "in-softirq-W",
453 [LOCK_ENABLED_SOFTIRQS] = "softirq-on-W", 453 [LOCK_ENABLED_SOFTIRQ] = "softirq-on-W",
454 [LOCK_ENABLED_HARDIRQS] = "hardirq-on-W", 454 [LOCK_ENABLED_HARDIRQ] = "hardirq-on-W",
455 [LOCK_USED_IN_HARDIRQ_READ] = "in-hardirq-R", 455 [LOCK_USED_IN_HARDIRQ_READ] = "in-hardirq-R",
456 [LOCK_USED_IN_SOFTIRQ_READ] = "in-softirq-R", 456 [LOCK_USED_IN_SOFTIRQ_READ] = "in-softirq-R",
457 [LOCK_ENABLED_SOFTIRQS_READ] = "softirq-on-R", 457 [LOCK_ENABLED_SOFTIRQ_READ] = "softirq-on-R",
458 [LOCK_ENABLED_HARDIRQS_READ] = "hardirq-on-R", 458 [LOCK_ENABLED_HARDIRQ_READ] = "hardirq-on-R",
459 [LOCK_USED_IN_RECLAIM_FS] = "in-reclaim-W", 459 [LOCK_USED_IN_RECLAIM_FS] = "in-reclaim-W",
460 [LOCK_USED_IN_RECLAIM_FS_READ] = "in-reclaim-R", 460 [LOCK_USED_IN_RECLAIM_FS_READ] = "in-reclaim-R",
461 [LOCK_HELD_OVER_RECLAIM_FS] = "ov-reclaim-W", 461 [LOCK_HELD_OVER_RECLAIM_FS] = "ov-reclaim-W",
@@ -476,28 +476,28 @@ get_usage_chars(struct lock_class *class, char *c1, char *c2, char *c3,
476 if (class->usage_mask & LOCKF_USED_IN_HARDIRQ) 476 if (class->usage_mask & LOCKF_USED_IN_HARDIRQ)
477 *c1 = '+'; 477 *c1 = '+';
478 else 478 else
479 if (class->usage_mask & LOCKF_ENABLED_HARDIRQS) 479 if (class->usage_mask & LOCKF_ENABLED_HARDIRQ)
480 *c1 = '-'; 480 *c1 = '-';
481 481
482 if (class->usage_mask & LOCKF_USED_IN_SOFTIRQ) 482 if (class->usage_mask & LOCKF_USED_IN_SOFTIRQ)
483 *c2 = '+'; 483 *c2 = '+';
484 else 484 else
485 if (class->usage_mask & LOCKF_ENABLED_SOFTIRQS) 485 if (class->usage_mask & LOCKF_ENABLED_SOFTIRQ)
486 *c2 = '-'; 486 *c2 = '-';
487 487
488 if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ) 488 if (class->usage_mask & LOCKF_ENABLED_HARDIRQ_READ)
489 *c3 = '-'; 489 *c3 = '-';
490 if (class->usage_mask & LOCKF_USED_IN_HARDIRQ_READ) { 490 if (class->usage_mask & LOCKF_USED_IN_HARDIRQ_READ) {
491 *c3 = '+'; 491 *c3 = '+';
492 if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ) 492 if (class->usage_mask & LOCKF_ENABLED_HARDIRQ_READ)
493 *c3 = '?'; 493 *c3 = '?';
494 } 494 }
495 495
496 if (class->usage_mask & LOCKF_ENABLED_SOFTIRQS_READ) 496 if (class->usage_mask & LOCKF_ENABLED_SOFTIRQ_READ)
497 *c4 = '-'; 497 *c4 = '-';
498 if (class->usage_mask & LOCKF_USED_IN_SOFTIRQ_READ) { 498 if (class->usage_mask & LOCKF_USED_IN_SOFTIRQ_READ) {
499 *c4 = '+'; 499 *c4 = '+';
500 if (class->usage_mask & LOCKF_ENABLED_SOFTIRQS_READ) 500 if (class->usage_mask & LOCKF_ENABLED_SOFTIRQ_READ)
501 *c4 = '?'; 501 *c4 = '?';
502 } 502 }
503 503
@@ -1296,7 +1296,7 @@ check_prev_add_irq(struct task_struct *curr, struct held_lock *prev,
1296 * forwards-subgraph starting at <next>: 1296 * forwards-subgraph starting at <next>:
1297 */ 1297 */
1298 if (!check_usage(curr, prev, next, LOCK_USED_IN_HARDIRQ, 1298 if (!check_usage(curr, prev, next, LOCK_USED_IN_HARDIRQ,
1299 LOCK_ENABLED_HARDIRQS, "hard")) 1299 LOCK_ENABLED_HARDIRQ, "hard"))
1300 return 0; 1300 return 0;
1301 1301
1302 /* 1302 /*
@@ -1306,7 +1306,7 @@ check_prev_add_irq(struct task_struct *curr, struct held_lock *prev,
1306 * forwards-subgraph starting at <next>: 1306 * forwards-subgraph starting at <next>:
1307 */ 1307 */
1308 if (!check_usage(curr, prev, next, LOCK_USED_IN_HARDIRQ_READ, 1308 if (!check_usage(curr, prev, next, LOCK_USED_IN_HARDIRQ_READ,
1309 LOCK_ENABLED_HARDIRQS, "hard-read")) 1309 LOCK_ENABLED_HARDIRQ, "hard-read"))
1310 return 0; 1310 return 0;
1311 1311
1312 /* 1312 /*
@@ -1316,7 +1316,7 @@ check_prev_add_irq(struct task_struct *curr, struct held_lock *prev,
1316 * forwards-subgraph starting at <next>: 1316 * forwards-subgraph starting at <next>:
1317 */ 1317 */
1318 if (!check_usage(curr, prev, next, LOCK_USED_IN_SOFTIRQ, 1318 if (!check_usage(curr, prev, next, LOCK_USED_IN_SOFTIRQ,
1319 LOCK_ENABLED_SOFTIRQS, "soft")) 1319 LOCK_ENABLED_SOFTIRQ, "soft"))
1320 return 0; 1320 return 0;
1321 /* 1321 /*
1322 * Prove that the new dependency does not connect a softirq-safe-read 1322 * Prove that the new dependency does not connect a softirq-safe-read
@@ -1325,7 +1325,7 @@ check_prev_add_irq(struct task_struct *curr, struct held_lock *prev,
1325 * forwards-subgraph starting at <next>: 1325 * forwards-subgraph starting at <next>:
1326 */ 1326 */
1327 if (!check_usage(curr, prev, next, LOCK_USED_IN_SOFTIRQ_READ, 1327 if (!check_usage(curr, prev, next, LOCK_USED_IN_SOFTIRQ_READ,
1328 LOCK_ENABLED_SOFTIRQS, "soft")) 1328 LOCK_ENABLED_SOFTIRQ, "soft"))
1329 return 0; 1329 return 0;
1330 1330
1331 /* 1331 /*
@@ -2008,17 +2008,17 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
2008 2008
2009 switch(new_bit) { 2009 switch(new_bit) {
2010 case LOCK_USED_IN_HARDIRQ: 2010 case LOCK_USED_IN_HARDIRQ:
2011 if (!valid_state(curr, this, new_bit, LOCK_ENABLED_HARDIRQS)) 2011 if (!valid_state(curr, this, new_bit, LOCK_ENABLED_HARDIRQ))
2012 return 0; 2012 return 0;
2013 if (!valid_state(curr, this, new_bit, 2013 if (!valid_state(curr, this, new_bit,
2014 LOCK_ENABLED_HARDIRQS_READ)) 2014 LOCK_ENABLED_HARDIRQ_READ))
2015 return 0; 2015 return 0;
2016 /* 2016 /*
2017 * just marked it hardirq-safe, check that this lock 2017 * just marked it hardirq-safe, check that this lock
2018 * took no hardirq-unsafe lock in the past: 2018 * took no hardirq-unsafe lock in the past:
2019 */ 2019 */
2020 if (!check_usage_forwards(curr, this, 2020 if (!check_usage_forwards(curr, this,
2021 LOCK_ENABLED_HARDIRQS, "hard")) 2021 LOCK_ENABLED_HARDIRQ, "hard"))
2022 return 0; 2022 return 0;
2023#if STRICT_READ_CHECKS 2023#if STRICT_READ_CHECKS
2024 /* 2024 /*
@@ -2026,24 +2026,24 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
2026 * took no hardirq-unsafe-read lock in the past: 2026 * took no hardirq-unsafe-read lock in the past:
2027 */ 2027 */
2028 if (!check_usage_forwards(curr, this, 2028 if (!check_usage_forwards(curr, this,
2029 LOCK_ENABLED_HARDIRQS_READ, "hard-read")) 2029 LOCK_ENABLED_HARDIRQ_READ, "hard-read"))
2030 return 0; 2030 return 0;
2031#endif 2031#endif
2032 if (hardirq_verbose(hlock_class(this))) 2032 if (hardirq_verbose(hlock_class(this)))
2033 ret = 2; 2033 ret = 2;
2034 break; 2034 break;
2035 case LOCK_USED_IN_SOFTIRQ: 2035 case LOCK_USED_IN_SOFTIRQ:
2036 if (!valid_state(curr, this, new_bit, LOCK_ENABLED_SOFTIRQS)) 2036 if (!valid_state(curr, this, new_bit, LOCK_ENABLED_SOFTIRQ))
2037 return 0; 2037 return 0;
2038 if (!valid_state(curr, this, new_bit, 2038 if (!valid_state(curr, this, new_bit,
2039 LOCK_ENABLED_SOFTIRQS_READ)) 2039 LOCK_ENABLED_SOFTIRQ_READ))
2040 return 0; 2040 return 0;
2041 /* 2041 /*
2042 * just marked it softirq-safe, check that this lock 2042 * just marked it softirq-safe, check that this lock
2043 * took no softirq-unsafe lock in the past: 2043 * took no softirq-unsafe lock in the past:
2044 */ 2044 */
2045 if (!check_usage_forwards(curr, this, 2045 if (!check_usage_forwards(curr, this,
2046 LOCK_ENABLED_SOFTIRQS, "soft")) 2046 LOCK_ENABLED_SOFTIRQ, "soft"))
2047 return 0; 2047 return 0;
2048#if STRICT_READ_CHECKS 2048#if STRICT_READ_CHECKS
2049 /* 2049 /*
@@ -2051,7 +2051,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
2051 * took no softirq-unsafe-read lock in the past: 2051 * took no softirq-unsafe-read lock in the past:
2052 */ 2052 */
2053 if (!check_usage_forwards(curr, this, 2053 if (!check_usage_forwards(curr, this,
2054 LOCK_ENABLED_SOFTIRQS_READ, "soft-read")) 2054 LOCK_ENABLED_SOFTIRQ_READ, "soft-read"))
2055 return 0; 2055 return 0;
2056#endif 2056#endif
2057 if (softirq_verbose(hlock_class(this))) 2057 if (softirq_verbose(hlock_class(this)))
@@ -2083,27 +2083,27 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
2083 ret = 2; 2083 ret = 2;
2084 break; 2084 break;
2085 case LOCK_USED_IN_HARDIRQ_READ: 2085 case LOCK_USED_IN_HARDIRQ_READ:
2086 if (!valid_state(curr, this, new_bit, LOCK_ENABLED_HARDIRQS)) 2086 if (!valid_state(curr, this, new_bit, LOCK_ENABLED_HARDIRQ))
2087 return 0; 2087 return 0;
2088 /* 2088 /*
2089 * just marked it hardirq-read-safe, check that this lock 2089 * just marked it hardirq-read-safe, check that this lock
2090 * took no hardirq-unsafe lock in the past: 2090 * took no hardirq-unsafe lock in the past:
2091 */ 2091 */
2092 if (!check_usage_forwards(curr, this, 2092 if (!check_usage_forwards(curr, this,
2093 LOCK_ENABLED_HARDIRQS, "hard")) 2093 LOCK_ENABLED_HARDIRQ, "hard"))
2094 return 0; 2094 return 0;
2095 if (hardirq_verbose(hlock_class(this))) 2095 if (hardirq_verbose(hlock_class(this)))
2096 ret = 2; 2096 ret = 2;
2097 break; 2097 break;
2098 case LOCK_USED_IN_SOFTIRQ_READ: 2098 case LOCK_USED_IN_SOFTIRQ_READ:
2099 if (!valid_state(curr, this, new_bit, LOCK_ENABLED_SOFTIRQS)) 2099 if (!valid_state(curr, this, new_bit, LOCK_ENABLED_SOFTIRQ))
2100 return 0; 2100 return 0;
2101 /* 2101 /*
2102 * just marked it softirq-read-safe, check that this lock 2102 * just marked it softirq-read-safe, check that this lock
2103 * took no softirq-unsafe lock in the past: 2103 * took no softirq-unsafe lock in the past:
2104 */ 2104 */
2105 if (!check_usage_forwards(curr, this, 2105 if (!check_usage_forwards(curr, this,
2106 LOCK_ENABLED_SOFTIRQS, "soft")) 2106 LOCK_ENABLED_SOFTIRQ, "soft"))
2107 return 0; 2107 return 0;
2108 if (softirq_verbose(hlock_class(this))) 2108 if (softirq_verbose(hlock_class(this)))
2109 ret = 2; 2109 ret = 2;
@@ -2121,7 +2121,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
2121 if (reclaim_verbose(hlock_class(this))) 2121 if (reclaim_verbose(hlock_class(this)))
2122 ret = 2; 2122 ret = 2;
2123 break; 2123 break;
2124 case LOCK_ENABLED_HARDIRQS: 2124 case LOCK_ENABLED_HARDIRQ:
2125 if (!valid_state(curr, this, new_bit, LOCK_USED_IN_HARDIRQ)) 2125 if (!valid_state(curr, this, new_bit, LOCK_USED_IN_HARDIRQ))
2126 return 0; 2126 return 0;
2127 if (!valid_state(curr, this, new_bit, 2127 if (!valid_state(curr, this, new_bit,
@@ -2147,7 +2147,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
2147 if (hardirq_verbose(hlock_class(this))) 2147 if (hardirq_verbose(hlock_class(this)))
2148 ret = 2; 2148 ret = 2;
2149 break; 2149 break;
2150 case LOCK_ENABLED_SOFTIRQS: 2150 case LOCK_ENABLED_SOFTIRQ:
2151 if (!valid_state(curr, this, new_bit, LOCK_USED_IN_SOFTIRQ)) 2151 if (!valid_state(curr, this, new_bit, LOCK_USED_IN_SOFTIRQ))
2152 return 0; 2152 return 0;
2153 if (!valid_state(curr, this, new_bit, 2153 if (!valid_state(curr, this, new_bit,
@@ -2199,7 +2199,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
2199 if (reclaim_verbose(hlock_class(this))) 2199 if (reclaim_verbose(hlock_class(this)))
2200 ret = 2; 2200 ret = 2;
2201 break; 2201 break;
2202 case LOCK_ENABLED_HARDIRQS_READ: 2202 case LOCK_ENABLED_HARDIRQ_READ:
2203 if (!valid_state(curr, this, new_bit, LOCK_USED_IN_HARDIRQ)) 2203 if (!valid_state(curr, this, new_bit, LOCK_USED_IN_HARDIRQ))
2204 return 0; 2204 return 0;
2205#if STRICT_READ_CHECKS 2205#if STRICT_READ_CHECKS
@@ -2214,7 +2214,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
2214 if (hardirq_verbose(hlock_class(this))) 2214 if (hardirq_verbose(hlock_class(this)))
2215 ret = 2; 2215 ret = 2;
2216 break; 2216 break;
2217 case LOCK_ENABLED_SOFTIRQS_READ: 2217 case LOCK_ENABLED_SOFTIRQ_READ:
2218 if (!valid_state(curr, this, new_bit, LOCK_USED_IN_SOFTIRQ)) 2218 if (!valid_state(curr, this, new_bit, LOCK_USED_IN_SOFTIRQ))
2219 return 0; 2219 return 0;
2220#if STRICT_READ_CHECKS 2220#if STRICT_READ_CHECKS
@@ -2274,16 +2274,16 @@ mark_held_locks(struct task_struct *curr, enum mark_type mark)
2274 switch (mark) { 2274 switch (mark) {
2275 case HARDIRQ: 2275 case HARDIRQ:
2276 if (hlock->read) 2276 if (hlock->read)
2277 usage_bit = LOCK_ENABLED_HARDIRQS_READ; 2277 usage_bit = LOCK_ENABLED_HARDIRQ_READ;
2278 else 2278 else
2279 usage_bit = LOCK_ENABLED_HARDIRQS; 2279 usage_bit = LOCK_ENABLED_HARDIRQ;
2280 break; 2280 break;
2281 2281
2282 case SOFTIRQ: 2282 case SOFTIRQ:
2283 if (hlock->read) 2283 if (hlock->read)
2284 usage_bit = LOCK_ENABLED_SOFTIRQS_READ; 2284 usage_bit = LOCK_ENABLED_SOFTIRQ_READ;
2285 else 2285 else
2286 usage_bit = LOCK_ENABLED_SOFTIRQS; 2286 usage_bit = LOCK_ENABLED_SOFTIRQ;
2287 break; 2287 break;
2288 2288
2289 case RECLAIM_FS: 2289 case RECLAIM_FS:
@@ -2520,19 +2520,19 @@ static int mark_irqflags(struct task_struct *curr, struct held_lock *hlock)
2520 if (!hlock->hardirqs_off) { 2520 if (!hlock->hardirqs_off) {
2521 if (hlock->read) { 2521 if (hlock->read) {
2522 if (!mark_lock(curr, hlock, 2522 if (!mark_lock(curr, hlock,
2523 LOCK_ENABLED_HARDIRQS_READ)) 2523 LOCK_ENABLED_HARDIRQ_READ))
2524 return 0; 2524 return 0;
2525 if (curr->softirqs_enabled) 2525 if (curr->softirqs_enabled)
2526 if (!mark_lock(curr, hlock, 2526 if (!mark_lock(curr, hlock,
2527 LOCK_ENABLED_SOFTIRQS_READ)) 2527 LOCK_ENABLED_SOFTIRQ_READ))
2528 return 0; 2528 return 0;
2529 } else { 2529 } else {
2530 if (!mark_lock(curr, hlock, 2530 if (!mark_lock(curr, hlock,
2531 LOCK_ENABLED_HARDIRQS)) 2531 LOCK_ENABLED_HARDIRQ))
2532 return 0; 2532 return 0;
2533 if (curr->softirqs_enabled) 2533 if (curr->softirqs_enabled)
2534 if (!mark_lock(curr, hlock, 2534 if (!mark_lock(curr, hlock,
2535 LOCK_ENABLED_SOFTIRQS)) 2535 LOCK_ENABLED_SOFTIRQ))
2536 return 0; 2536 return 0;
2537 } 2537 }
2538 } 2538 }
@@ -2640,10 +2640,10 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,
2640 case LOCK_USED_IN_SOFTIRQ: 2640 case LOCK_USED_IN_SOFTIRQ:
2641 case LOCK_USED_IN_HARDIRQ_READ: 2641 case LOCK_USED_IN_HARDIRQ_READ:
2642 case LOCK_USED_IN_SOFTIRQ_READ: 2642 case LOCK_USED_IN_SOFTIRQ_READ:
2643 case LOCK_ENABLED_HARDIRQS: 2643 case LOCK_ENABLED_HARDIRQ:
2644 case LOCK_ENABLED_SOFTIRQS: 2644 case LOCK_ENABLED_SOFTIRQ:
2645 case LOCK_ENABLED_HARDIRQS_READ: 2645 case LOCK_ENABLED_HARDIRQ_READ:
2646 case LOCK_ENABLED_SOFTIRQS_READ: 2646 case LOCK_ENABLED_SOFTIRQ_READ:
2647 case LOCK_USED_IN_RECLAIM_FS: 2647 case LOCK_USED_IN_RECLAIM_FS:
2648 case LOCK_USED_IN_RECLAIM_FS_READ: 2648 case LOCK_USED_IN_RECLAIM_FS_READ:
2649 case LOCK_HELD_OVER_RECLAIM_FS: 2649 case LOCK_HELD_OVER_RECLAIM_FS: