diff options
| author | John W. Linville <linville@tuxdriver.com> | 2006-07-27 14:27:06 -0400 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2006-07-27 14:27:06 -0400 |
| commit | 20f99dcf417a28089ef6c877ae97f5dec2eab435 (patch) | |
| tree | b4fe1f3e429d6a82ddaaa8e12899da630cfa8a63 /lib | |
| parent | dd2f5538a157bda68bfa8efb39feaaccdda9e74e (diff) | |
| parent | 64821324ca49f24be1a66f2f432108f96a24e596 (diff) | |
Merge branch 'from-linus' into upstream
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Kconfig.debug | 10 | ||||
| -rw-r--r-- | lib/idr.c | 16 |
2 files changed, 16 insertions, 10 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index e5889b1a33ff..554ee688a9f8 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
| @@ -158,7 +158,7 @@ config DEBUG_RWSEMS | |||
| 158 | 158 | ||
| 159 | config DEBUG_LOCK_ALLOC | 159 | config DEBUG_LOCK_ALLOC |
| 160 | bool "Lock debugging: detect incorrect freeing of live locks" | 160 | bool "Lock debugging: detect incorrect freeing of live locks" |
| 161 | depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT | 161 | depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT |
| 162 | select DEBUG_SPINLOCK | 162 | select DEBUG_SPINLOCK |
| 163 | select DEBUG_MUTEXES | 163 | select DEBUG_MUTEXES |
| 164 | select DEBUG_RWSEMS | 164 | select DEBUG_RWSEMS |
| @@ -173,7 +173,7 @@ config DEBUG_LOCK_ALLOC | |||
| 173 | 173 | ||
| 174 | config PROVE_LOCKING | 174 | config PROVE_LOCKING |
| 175 | bool "Lock debugging: prove locking correctness" | 175 | bool "Lock debugging: prove locking correctness" |
| 176 | depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT | 176 | depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT |
| 177 | select LOCKDEP | 177 | select LOCKDEP |
| 178 | select DEBUG_SPINLOCK | 178 | select DEBUG_SPINLOCK |
| 179 | select DEBUG_MUTEXES | 179 | select DEBUG_MUTEXES |
| @@ -216,7 +216,7 @@ config PROVE_LOCKING | |||
| 216 | 216 | ||
| 217 | config LOCKDEP | 217 | config LOCKDEP |
| 218 | bool | 218 | bool |
| 219 | depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT | 219 | depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT |
| 220 | select STACKTRACE | 220 | select STACKTRACE |
| 221 | select FRAME_POINTER | 221 | select FRAME_POINTER |
| 222 | select KALLSYMS | 222 | select KALLSYMS |
| @@ -224,13 +224,14 @@ config LOCKDEP | |||
| 224 | 224 | ||
| 225 | config DEBUG_LOCKDEP | 225 | config DEBUG_LOCKDEP |
| 226 | bool "Lock dependency engine debugging" | 226 | bool "Lock dependency engine debugging" |
| 227 | depends on LOCKDEP | 227 | depends on DEBUG_KERNEL && LOCKDEP |
| 228 | help | 228 | help |
| 229 | If you say Y here, the lock dependency engine will do | 229 | If you say Y here, the lock dependency engine will do |
| 230 | additional runtime checks to debug itself, at the price | 230 | additional runtime checks to debug itself, at the price |
| 231 | of more runtime overhead. | 231 | of more runtime overhead. |
| 232 | 232 | ||
| 233 | config TRACE_IRQFLAGS | 233 | config TRACE_IRQFLAGS |
| 234 | depends on DEBUG_KERNEL | ||
| 234 | bool | 235 | bool |
| 235 | default y | 236 | default y |
| 236 | depends on TRACE_IRQFLAGS_SUPPORT | 237 | depends on TRACE_IRQFLAGS_SUPPORT |
| @@ -256,6 +257,7 @@ config DEBUG_LOCKING_API_SELFTESTS | |||
| 256 | 257 | ||
| 257 | config STACKTRACE | 258 | config STACKTRACE |
| 258 | bool | 259 | bool |
| 260 | depends on DEBUG_KERNEL | ||
| 259 | depends on STACKTRACE_SUPPORT | 261 | depends on STACKTRACE_SUPPORT |
| 260 | 262 | ||
| 261 | config DEBUG_KOBJECT | 263 | config DEBUG_KOBJECT |
| @@ -38,14 +38,15 @@ static kmem_cache_t *idr_layer_cache; | |||
| 38 | static struct idr_layer *alloc_layer(struct idr *idp) | 38 | static struct idr_layer *alloc_layer(struct idr *idp) |
| 39 | { | 39 | { |
| 40 | struct idr_layer *p; | 40 | struct idr_layer *p; |
| 41 | unsigned long flags; | ||
| 41 | 42 | ||
| 42 | spin_lock(&idp->lock); | 43 | spin_lock_irqsave(&idp->lock, flags); |
| 43 | if ((p = idp->id_free)) { | 44 | if ((p = idp->id_free)) { |
| 44 | idp->id_free = p->ary[0]; | 45 | idp->id_free = p->ary[0]; |
| 45 | idp->id_free_cnt--; | 46 | idp->id_free_cnt--; |
| 46 | p->ary[0] = NULL; | 47 | p->ary[0] = NULL; |
| 47 | } | 48 | } |
| 48 | spin_unlock(&idp->lock); | 49 | spin_unlock_irqrestore(&idp->lock, flags); |
| 49 | return(p); | 50 | return(p); |
| 50 | } | 51 | } |
| 51 | 52 | ||
| @@ -59,12 +60,14 @@ static void __free_layer(struct idr *idp, struct idr_layer *p) | |||
| 59 | 60 | ||
| 60 | static void free_layer(struct idr *idp, struct idr_layer *p) | 61 | static void free_layer(struct idr *idp, struct idr_layer *p) |
| 61 | { | 62 | { |
| 63 | unsigned long flags; | ||
| 64 | |||
| 62 | /* | 65 | /* |
| 63 | * Depends on the return element being zeroed. | 66 | * Depends on the return element being zeroed. |
| 64 | */ | 67 | */ |
| 65 | spin_lock(&idp->lock); | 68 | spin_lock_irqsave(&idp->lock, flags); |
| 66 | __free_layer(idp, p); | 69 | __free_layer(idp, p); |
| 67 | spin_unlock(&idp->lock); | 70 | spin_unlock_irqrestore(&idp->lock, flags); |
| 68 | } | 71 | } |
| 69 | 72 | ||
| 70 | /** | 73 | /** |
| @@ -168,6 +171,7 @@ static int idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id) | |||
| 168 | { | 171 | { |
| 169 | struct idr_layer *p, *new; | 172 | struct idr_layer *p, *new; |
| 170 | int layers, v, id; | 173 | int layers, v, id; |
| 174 | unsigned long flags; | ||
| 171 | 175 | ||
| 172 | id = starting_id; | 176 | id = starting_id; |
| 173 | build_up: | 177 | build_up: |
| @@ -191,14 +195,14 @@ build_up: | |||
| 191 | * The allocation failed. If we built part of | 195 | * The allocation failed. If we built part of |
| 192 | * the structure tear it down. | 196 | * the structure tear it down. |
| 193 | */ | 197 | */ |
| 194 | spin_lock(&idp->lock); | 198 | spin_lock_irqsave(&idp->lock, flags); |
| 195 | for (new = p; p && p != idp->top; new = p) { | 199 | for (new = p; p && p != idp->top; new = p) { |
| 196 | p = p->ary[0]; | 200 | p = p->ary[0]; |
| 197 | new->ary[0] = NULL; | 201 | new->ary[0] = NULL; |
| 198 | new->bitmap = new->count = 0; | 202 | new->bitmap = new->count = 0; |
| 199 | __free_layer(idp, new); | 203 | __free_layer(idp, new); |
| 200 | } | 204 | } |
| 201 | spin_unlock(&idp->lock); | 205 | spin_unlock_irqrestore(&idp->lock, flags); |
| 202 | return -1; | 206 | return -1; |
| 203 | } | 207 | } |
| 204 | new->ary[0] = p; | 208 | new->ary[0] = p; |
