locking/lockdep: Apply crossrelease to completions
authorByungchul Park <byungchul.park@lge.com>
Mon, 7 Aug 2017 07:12:56 +0000 (16:12 +0900)
committerIngo Molnar <mingo@kernel.org>
Thu, 10 Aug 2017 10:29:10 +0000 (12:29 +0200)
commitcd8084f91c02c1afd256a39aa833bff737631304
treea2eb7a1ce13798602affca1f244dbccc583b3952
parent383a4bc88849b804385162e81bf704f8f9690a87
locking/lockdep: Apply crossrelease to completions

Although wait_for_completion() and its family can cause deadlock, the
lock correctness validator could not be applied to them until now,
because things like complete() are usually called in a different context
from the waiting context, which violates lockdep's assumption.

Thanks to CONFIG_LOCKDEP_CROSSRELEASE, we can now apply the lockdep
detector to those completion operations. Applied it.

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-10-git-send-email-byungchul.park@lge.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/completion.h
kernel/sched/completion.c
lib/Kconfig.debug