* [PATCH 2.6.19-rc2-git3] lockdep: internal locking fixes
@ 2006-10-20 6:12 Jarek Poplawski
2006-10-20 12:11 ` [PATCH 2.6.19-rc2-git3][REVISED] " Jarek Poplawski
0 siblings, 1 reply; 3+ messages in thread
From: Jarek Poplawski @ 2006-10-20 6:12 UTC (permalink / raw)
To: linux-kernel; +Cc: mingo
Hello,
Here are mainly some lockdep returns with 0 with unlocking fixes.
Regards,
Jarek P.
PS: if there will be any questions after 3PM EST
I'll be back on monday.
Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>
---
diff -Nurp linux-2.6.19-rc2-git3-/kernel/lockdep.c linux-2.6.19-rc2-git3/kernel/lockdep.c
--- linux-2.6.19-rc2-git3-/kernel/lockdep.c 2006-10-19 18:41:00.000000000 +0200
+++ linux-2.6.19-rc2-git3/kernel/lockdep.c 2006-10-19 23:27:51.000000000 +0200
@@ -227,9 +227,9 @@ static int save_trace(struct stack_trace
trace->skip = 3;
trace->all_contexts = 0;
-
- /* Make sure to not recurse in case the the unwinder needs to tak
-e locks. */
+ /*
+ * Make sure to not recurse in case the unwinder needs to take locks.
+ */
lockdep_off();
save_stack_trace(trace, NULL);
lockdep_on();
@@ -237,8 +237,10 @@ e locks. */
trace->max_entries = trace->nr_entries;
nr_stack_trace_entries += trace->nr_entries;
- if (DEBUG_LOCKS_WARN_ON(nr_stack_trace_entries > MAX_STACK_TRACE_ENTRIES))
+ if (DEBUG_LOCKS_WARN_ON(nr_stack_trace_entries > MAX_STACK_TRACE_ENTRIES)) {
+ __raw_spin_unlock(&hash_lock);
return 0;
+ }
if (nr_stack_trace_entries == MAX_STACK_TRACE_ENTRIES) {
__raw_spin_unlock(&hash_lock);
@@ -474,7 +476,8 @@ static int add_lock_to_list(struct lock_
return 0;
entry->class = this;
- save_trace(&entry->trace);
+ if (!save_trace(&entry->trace))
+ return 0;
/*
* Since we never remove from the dependency list, the list can
@@ -563,7 +566,10 @@ static noinline int print_circular_bug_t
return 0;
this.class = check_source->class;
- save_trace(&this.trace);
+ /* hash_lock unlocked by the header */
+ __raw_spin_lock(&hash_lock);
+ if (!save_trace(&this.trace))
+ return 0;
print_circular_bug_entry(&this, 0);
printk("\nother info that might help us debug this:\n\n");
@@ -959,6 +965,9 @@ check_prev_add(struct task_struct *curr,
}
/*
+ * Return value of 2 signals 'dependency already added',
+ * in that case we dont have to add the backlink either.
+ *
* Ok, all validations passed, add the new lock
* to the previous lock's dependency list:
*/
@@ -966,15 +975,10 @@ check_prev_add(struct task_struct *curr,
&prev->class->locks_after, next->acquire_ip);
if (!ret)
return 0;
- /*
- * Return value of 2 signals 'dependency already added',
- * in that case we dont have to add the backlink either.
- */
- if (ret == 2)
- return 2;
ret = add_lock_to_list(next->class, prev->class,
&next->class->locks_before, next->acquire_ip);
-
+ if (!ret)
+ return 0;
/*
* Debugging printouts:
*/
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH 2.6.19-rc2-git3][REVISED] lockdep: internal locking fixes 2006-10-20 6:12 [PATCH 2.6.19-rc2-git3] lockdep: internal locking fixes Jarek Poplawski @ 2006-10-20 12:11 ` Jarek Poplawski 2006-10-20 13:04 ` [PATCH 2.6.19-rc2-git3][REVISED 2] " Jarek Poplawski 0 siblings, 1 reply; 3+ messages in thread From: Jarek Poplawski @ 2006-10-20 12:11 UTC (permalink / raw) To: linux-kernel, mingo On Fri, Oct 20, 2006 at 08:12:34AM +0200, Jarek Poplawski wrote: >Hello, ... Sorry - one more fix! Here are mainly some lockdep returns with 0 with unlocking fixes. Best regards, Jarek P. PS: if there will be any questions after 3PM EST I'll be back on monday. Signed-off-by: Jarek Poplawski <jarkao2@o2.pl> --- diff -Nurp linux-2.6.19-rc2-git3-/kernel/lockdep.c linux-2.6.19-rc2-git3/kernel/lockdep.c --- linux-2.6.19-rc2-git3-/kernel/lockdep.c 2006-10-19 18:41:00.000000000 +0200 +++ linux-2.6.19-rc2-git3/kernel/lockdep.c 2006-10-20 13:59:14.000000000 +0200 @@ -227,9 +227,9 @@ static int save_trace(struct stack_trace trace->skip = 3; trace->all_contexts = 0; - - /* Make sure to not recurse in case the the unwinder needs to tak -e locks. */ + /* + * Make sure to not recurse in case the unwinder needs to take locks. + */ lockdep_off(); save_stack_trace(trace, NULL); lockdep_on(); @@ -237,8 +237,10 @@ e locks. */ trace->max_entries = trace->nr_entries; nr_stack_trace_entries += trace->nr_entries; - if (DEBUG_LOCKS_WARN_ON(nr_stack_trace_entries > MAX_STACK_TRACE_ENTRIES)) + if (DEBUG_LOCKS_WARN_ON(nr_stack_trace_entries > MAX_STACK_TRACE_ENTRIES)) { + __raw_spin_unlock(&hash_lock); return 0; + } if (nr_stack_trace_entries == MAX_STACK_TRACE_ENTRIES) { __raw_spin_unlock(&hash_lock); @@ -474,7 +476,8 @@ static int add_lock_to_list(struct lock_ return 0; entry->class = this; - save_trace(&entry->trace); + if (!save_trace(&entry->trace)) + return 0; /* * Since we never remove from the dependency list, the list can @@ -562,8 +565,12 @@ static noinline int print_circular_bug_t if (debug_locks_silent) return 0; + /* hash_lock unlocked by the header */ + __raw_spin_lock(&hash_lock); this.class = check_source->class; - save_trace(&this.trace); + if (!save_trace(&this.trace)) + return 0; + __raw_spin_unlock(&hash_lock); print_circular_bug_entry(&this, 0); printk("\nother info that might help us debug this:\n\n"); @@ -959,6 +966,9 @@ check_prev_add(struct task_struct *curr, } /* + * Return value of 2 signals 'dependency already added', + * in that case we dont have to add the backlink either. + * * Ok, all validations passed, add the new lock * to the previous lock's dependency list: */ @@ -966,15 +976,10 @@ check_prev_add(struct task_struct *curr, &prev->class->locks_after, next->acquire_ip); if (!ret) return 0; - /* - * Return value of 2 signals 'dependency already added', - * in that case we dont have to add the backlink either. - */ - if (ret == 2) - return 2; ret = add_lock_to_list(next->class, prev->class, &next->class->locks_before, next->acquire_ip); - + if (!ret) + return 0; /* * Debugging printouts: */ ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2.6.19-rc2-git3][REVISED 2] lockdep: internal locking fixes 2006-10-20 12:11 ` [PATCH 2.6.19-rc2-git3][REVISED] " Jarek Poplawski @ 2006-10-20 13:04 ` Jarek Poplawski 0 siblings, 0 replies; 3+ messages in thread From: Jarek Poplawski @ 2006-10-20 13:04 UTC (permalink / raw) To: linux-kernel, mingo On Fri, Oct 20, 2006 at 02:11:45PM +0200, Jarek Poplawski wrote: > On Fri, Oct 20, 2006 at 08:12:34AM +0200, Jarek Poplawski wrote: > >Hello, ... Very sorry - one more fix! Here are mainly some lockdep returns with 0 with unlocking fixes. Best regards and cheers, Jarek P. PS: I'll be back on monday. Signed-off-by: Jarek Poplawski <jarkao2@o2.pl> --- diff -Nurp linux-2.6.19-rc2-git3-/kernel/lockdep.c linux-2.6.19-rc2-git3/kernel/lockdep.c --- linux-2.6.19-rc2-git3-/kernel/lockdep.c 2006-10-19 18:41:00.000000000 +0200 +++ linux-2.6.19-rc2-git3/kernel/lockdep.c 2006-10-20 14:58:21.000000000 +0200 @@ -227,9 +227,9 @@ static int save_trace(struct stack_trace trace->skip = 3; trace->all_contexts = 0; - - /* Make sure to not recurse in case the the unwinder needs to tak -e locks. */ + /* + * Make sure to not recurse in case the unwinder needs to take locks. + */ lockdep_off(); save_stack_trace(trace, NULL); lockdep_on(); @@ -237,8 +237,10 @@ e locks. */ trace->max_entries = trace->nr_entries; nr_stack_trace_entries += trace->nr_entries; - if (DEBUG_LOCKS_WARN_ON(nr_stack_trace_entries > MAX_STACK_TRACE_ENTRIES)) + if (DEBUG_LOCKS_WARN_ON(nr_stack_trace_entries > MAX_STACK_TRACE_ENTRIES)) { + __raw_spin_unlock(&hash_lock); return 0; + } if (nr_stack_trace_entries == MAX_STACK_TRACE_ENTRIES) { __raw_spin_unlock(&hash_lock); @@ -474,7 +476,8 @@ static int add_lock_to_list(struct lock_ return 0; entry->class = this; - save_trace(&entry->trace); + if (!save_trace(&entry->trace)) + return 0; /* * Since we never remove from the dependency list, the list can @@ -562,8 +565,12 @@ static noinline int print_circular_bug_t if (debug_locks_silent) return 0; + /* hash_lock unlocked by the header */ + __raw_spin_lock(&hash_lock); this.class = check_source->class; - save_trace(&this.trace); + if (!save_trace(&this.trace)) + return 0; + __raw_spin_unlock(&hash_lock); print_circular_bug_entry(&this, 0); printk("\nother info that might help us debug this:\n\n"); @@ -959,6 +966,9 @@ check_prev_add(struct task_struct *curr, } /* + * Return value of 2 signals 'dependency already added', + * in that case we dont have to add the backlink either. + * * Ok, all validations passed, add the new lock * to the previous lock's dependency list: */ @@ -966,15 +976,10 @@ check_prev_add(struct task_struct *curr, &prev->class->locks_after, next->acquire_ip); if (!ret) return 0; - /* - * Return value of 2 signals 'dependency already added', - * in that case we dont have to add the backlink either. - */ - if (ret == 2) - return 2; ret = add_lock_to_list(next->class, prev->class, &next->class->locks_before, next->acquire_ip); - + if (!ret) + return 0; /* * Debugging printouts: */ @@ -1025,7 +1030,8 @@ check_prevs_add(struct task_struct *curr * added: */ if (hlock->read != 2) { - check_prev_add(curr, hlock, next); + if (!check_prev_add(curr, hlock, next)) + return 0; /* * Stop after the first non-trylock entry, * as non-trylock entries have added their ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-10-20 12:59 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-10-20 6:12 [PATCH 2.6.19-rc2-git3] lockdep: internal locking fixes Jarek Poplawski 2006-10-20 12:11 ` [PATCH 2.6.19-rc2-git3][REVISED] " Jarek Poplawski 2006-10-20 13:04 ` [PATCH 2.6.19-rc2-git3][REVISED 2] " Jarek Poplawski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox