Messages in this thread |  | | | Date | Mon, 13 Jul 2009 16:08:16 +0800 | | Subject | Re: [RESEND PATCH 04/11] kernel:lockdep:implement check_noncircular() by BFS | | From | Dave Young <> |
| |
On Mon, Jul 13, 2009 at 4:02 PM, Dave Young<hidave.darkstar@gmail.com> wrote: > On Sun, Jun 28, 2009 at 11:04:39PM +0800, tom.leiming@gmail.com wrote: >> From: Ming Lei <tom.leiming@gmail.com> >> >> This patch uses BFS to implement check_noncircular() and >> prints the generated shortest circle if exists. >> >> Signed-off-by: Ming Lei <tom.leiming@gmail.com> >> --- >> kernel/lockdep.c | 89 ++++++++++++++++++++++------------------------------- >> 1 files changed, 37 insertions(+), 52 deletions(-) >> >> diff --git a/kernel/lockdep.c b/kernel/lockdep.c >> index ce6d09e..f740088 100644 >> --- a/kernel/lockdep.c >> +++ b/kernel/lockdep.c >> @@ -985,12 +985,7 @@ static inline int __bfs_backward(struct lock_list *src_entry, >> * Recursive, forwards-direction lock-dependency checking, used for >> * both noncyclic checking and for hardirq-unsafe/softirq-unsafe >> * checking. >> - * >> - * (to keep the stackframe of the recursive functions small we >> - * use these global variables, and we also mark various helper >> - * functions as noinline.) >> */ >> -static struct held_lock *check_source, *check_target; >> >> /* >> * Print a dependency chain entry (this is only done when a deadlock >> @@ -1014,7 +1009,9 @@ print_circular_bug_entry(struct lock_list *target, unsigned int depth) >> * header first: >> */ >> static noinline int >> -print_circular_bug_header(struct lock_list *entry, unsigned int depth) >> +print_circular_bug_header(struct lock_list *entry, unsigned int depth, >> + struct held_lock *check_src, >> + struct held_lock *check_tgt) >> { >> struct task_struct *curr = current; >> >> @@ -1027,9 +1024,9 @@ print_circular_bug_header(struct lock_list *entry, unsigned int depth) >> printk( "-------------------------------------------------------\n"); >> printk("%s/%d is trying to acquire lock:\n", >> curr->comm, task_pid_nr(curr)); >> - print_lock(check_source); >> + print_lock(check_src); >> printk("\nbut task is already holding lock:\n"); >> - print_lock(check_target); >> + print_lock(check_tgt); >> printk("\nwhich lock already depends on the new lock.\n\n"); >> printk("\nthe existing dependency chain (in reverse order) is:\n"); >> >> @@ -1043,36 +1040,24 @@ static inline int class_equal(struct lock_list *entry, void *data) >> return entry->class == data; >> } >> >> -static noinline int print_circular_bug(void) >> +static noinline int print_circular_bug(struct lock_list *this, > > Shouldn't be 'static noinline int' here? Same question to following ones. >
Sorry for pointing to wrong place. please grep to find them:
161:+static int noinline print_bfs_bug(int ret) 173: static int noinline print_infinite_recursion_bug(void)
-- Regards dave -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |