diff options
-rw-r--r-- | kernel/lockdep.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 27c609f3eae5..63437d065ac8 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -1973,7 +1973,7 @@ static inline int lookup_chain_cache(struct task_struct *curr, | |||
1973 | struct list_head *hash_head = chainhashentry(chain_key); | 1973 | struct list_head *hash_head = chainhashentry(chain_key); |
1974 | struct lock_chain *chain; | 1974 | struct lock_chain *chain; |
1975 | struct held_lock *hlock_curr, *hlock_next; | 1975 | struct held_lock *hlock_curr, *hlock_next; |
1976 | int i, j, n, cn; | 1976 | int i, j; |
1977 | 1977 | ||
1978 | if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) | 1978 | if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) |
1979 | return 0; | 1979 | return 0; |
@@ -2033,15 +2033,9 @@ cache_hit: | |||
2033 | } | 2033 | } |
2034 | i++; | 2034 | i++; |
2035 | chain->depth = curr->lockdep_depth + 1 - i; | 2035 | chain->depth = curr->lockdep_depth + 1 - i; |
2036 | cn = nr_chain_hlocks; | 2036 | if (likely(nr_chain_hlocks + chain->depth <= MAX_LOCKDEP_CHAIN_HLOCKS)) { |
2037 | while (cn + chain->depth <= MAX_LOCKDEP_CHAIN_HLOCKS) { | 2037 | chain->base = nr_chain_hlocks; |
2038 | n = cmpxchg(&nr_chain_hlocks, cn, cn + chain->depth); | 2038 | nr_chain_hlocks += chain->depth; |
2039 | if (n == cn) | ||
2040 | break; | ||
2041 | cn = n; | ||
2042 | } | ||
2043 | if (likely(cn + chain->depth <= MAX_LOCKDEP_CHAIN_HLOCKS)) { | ||
2044 | chain->base = cn; | ||
2045 | for (j = 0; j < chain->depth - 1; j++, i++) { | 2039 | for (j = 0; j < chain->depth - 1; j++, i++) { |
2046 | int lock_id = curr->held_locks[i].class_idx - 1; | 2040 | int lock_id = curr->held_locks[i].class_idx - 1; |
2047 | chain_hlocks[chain->base + j] = lock_id; | 2041 | chain_hlocks[chain->base + j] = lock_id; |