Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1561788
| From | Byungchul Park <byungchul.park@lge.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v5 07/13] lockdep: Make print_circular_bug() aware of crossrelease |
| Date | 2017-01-18 14:30 +0100 |
| Message-ID | <t0Ytm-4D1-75@gated-at.bofh.it> (permalink) |
| References | <t0YjD-4z4-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
print_circular_bug() reporting circular bug assumes that target hlock is
owned by the current. However, in crossrelease, target hlock can be
owned by other than the current. So the report format needs to be
changed to reflect the change.
Signed-off-by: Byungchul Park <byungchul.park@lge.com>
---
kernel/locking/lockdep.c | 56 +++++++++++++++++++++++++++++++++---------------
1 file changed, 39 insertions(+), 17 deletions(-)
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 0621b3e..49b9386 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -1129,22 +1129,41 @@ static inline int __bfs_backwards(struct lock_list *src_entry,
printk(KERN_CONT "\n\n");
}
- printk(" Possible unsafe locking scenario:\n\n");
- printk(" CPU0 CPU1\n");
- printk(" ---- ----\n");
- printk(" lock(");
- __print_lock_name(target);
- printk(KERN_CONT ");\n");
- printk(" lock(");
- __print_lock_name(parent);
- printk(KERN_CONT ");\n");
- printk(" lock(");
- __print_lock_name(target);
- printk(KERN_CONT ");\n");
- printk(" lock(");
- __print_lock_name(source);
- printk(KERN_CONT ");\n");
- printk("\n *** DEADLOCK ***\n\n");
+ if (cross_lock(tgt->instance)) {
+ printk(" Possible unsafe locking scenario by crosslock:\n\n");
+ printk(" CPU0 CPU1\n");
+ printk(" ---- ----\n");
+ printk(" lock(");
+ __print_lock_name(parent);
+ printk(KERN_CONT ");\n");
+ printk(" lock(");
+ __print_lock_name(target);
+ printk(KERN_CONT ");\n");
+ printk(" lock(");
+ __print_lock_name(source);
+ printk(KERN_CONT ");\n");
+ printk(" unlock(");
+ __print_lock_name(target);
+ printk(KERN_CONT ");\n");
+ printk("\n *** DEADLOCK ***\n\n");
+ } else {
+ printk(" Possible unsafe locking scenario:\n\n");
+ printk(" CPU0 CPU1\n");
+ printk(" ---- ----\n");
+ printk(" lock(");
+ __print_lock_name(target);
+ printk(KERN_CONT ");\n");
+ printk(" lock(");
+ __print_lock_name(parent);
+ printk(KERN_CONT ");\n");
+ printk(" lock(");
+ __print_lock_name(target);
+ printk(KERN_CONT ");\n");
+ printk(" lock(");
+ __print_lock_name(source);
+ printk(KERN_CONT ");\n");
+ printk("\n *** DEADLOCK ***\n\n");
+ }
}
/*
@@ -1169,7 +1188,10 @@ static inline int __bfs_backwards(struct lock_list *src_entry,
printk("%s/%d is trying to acquire lock:\n",
curr->comm, task_pid_nr(curr));
print_lock(check_src);
- printk("\nbut task is already holding lock:\n");
+ if (cross_lock(check_tgt->instance))
+ printk("\nbut now in the release context of lock:\n");
+ else
+ printk("\nbut task is already holding lock:\n");
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");
--
1.9.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v5 00/13] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-01-18 14:20 +0100
[PATCH v5 01/13] lockdep: Refactor lookup_chain_cache() Byungchul Park <byungchul.park@lge.com> - 2017-01-18 14:20 +0100
Re: [PATCH v5 01/13] lockdep: Refactor lookup_chain_cache() Boqun Feng <boqun.feng@gmail.com> - 2017-01-19 10:20 +0100
Re: [PATCH v5 01/13] lockdep: Refactor lookup_chain_cache() Byungchul Park <byungchul.park@lge.com> - 2017-01-19 11:10 +0100
Re: [PATCH v5 01/13] lockdep: Refactor lookup_chain_cache() Byungchul Park <byungchul.park@lge.com> - 2017-01-26 09:00 +0100
[PATCH v5 09/13] pagemap.h: Remove trailing white space Byungchul Park <byungchul.park@lge.com> - 2017-01-18 14:30 +0100
[PATCH v5 10/13] lockdep: Apply crossrelease to PG_locked locks Byungchul Park <byungchul.park@lge.com> - 2017-01-18 14:30 +0100
[PATCH v5 13/13] lockdep: Crossrelease feature documentation Byungchul Park <byungchul.park@lge.com> - 2017-01-18 14:30 +0100
[REVISED DOCUMENT] lockdep: Crossrelease feature documentation Byungchul Park <byungchul.park@lge.com> - 2017-01-20 10:10 +0100
[PATCH v5 06/13] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-01-18 14:30 +0100
[PATCH v5 08/13] lockdep: Apply crossrelease to completions Byungchul Park <byungchul.park@lge.com> - 2017-01-18 14:30 +0100
[PATCH v5 11/13] lockdep: Apply lock_acquire(release) on __Set(__Clear)PageLocked Byungchul Park <byungchul.park@lge.com> - 2017-01-18 14:30 +0100
[PATCH v5 03/13] lockdep: Add a function building a chain between two classes Byungchul Park <byungchul.park@lge.com> - 2017-01-18 14:30 +0100
[PATCH v5 07/13] lockdep: Make print_circular_bug() aware of crossrelease Byungchul Park <byungchul.park@lge.com> - 2017-01-18 14:30 +0100
[PATCH v5 05/13] lockdep: Pass a callback arg to check_prev_add() to handle stack_trace Byungchul Park <byungchul.park@lge.com> - 2017-01-18 14:30 +0100
Re: [PATCH v5 05/13] lockdep: Pass a callback arg to check_prev_add() to handle stack_trace Byungchul Park <byungchul.park@lge.com> - 2017-01-26 08:50 +0100
csiph-web