mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
locking/lockdep: Implement the 'crossrelease' feature
Lockdep is a runtime locking correctness validator that detects and reports a deadlock or its possibility by checking dependencies between locks. It's useful since it does not report just an actual deadlock but also the possibility of a deadlock that has not actually happened yet. That enables problems to be fixed before they affect real systems. However, this facility is only applicable to typical locks, such as spinlocks and mutexes, which are normally released within the context in which they were acquired. However, synchronization primitives like page locks or completions, which are allowed to be released in any context, also create dependencies and can cause a deadlock. So lockdep should track these locks to do a better job. The 'crossrelease' implementation makes these primitives also be tracked. Signed-off-by: Byungchul Park <byungchul.park@lge.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: akpm@linux-foundation.org Cc: boqun.feng@gmail.com Cc: kernel-team@lge.com Cc: kirill@shutemov.name Cc: npiggin@gmail.com Cc: walken@google.com Cc: willy@infradead.org Link: http://lkml.kernel.org/r/1502089981-21272-6-git-send-email-byungchul.park@lge.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
ce07a9415f
commit
b09be676e0
8 changed files with 635 additions and 34 deletions
|
@ -2093,6 +2093,7 @@ __acquires(&pool->lock)
|
|||
|
||||
lock_map_acquire_read(&pwq->wq->lockdep_map);
|
||||
lock_map_acquire(&lockdep_map);
|
||||
crossrelease_hist_start(XHLOCK_PROC);
|
||||
trace_workqueue_execute_start(work);
|
||||
worker->current_func(work);
|
||||
/*
|
||||
|
@ -2100,6 +2101,7 @@ __acquires(&pool->lock)
|
|||
* point will only record its address.
|
||||
*/
|
||||
trace_workqueue_execute_end(work);
|
||||
crossrelease_hist_end(XHLOCK_PROC);
|
||||
lock_map_release(&lockdep_map);
|
||||
lock_map_release(&pwq->wq->lockdep_map);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue