locking/lockdep: Eliminate redundant IRQs check in __lock_acquire()
authorWaiman Long <longman@redhat.com>
Tue, 2 Oct 2018 20:19:17 +0000 (16:19 -0400)
committerIngo Molnar <mingo@kernel.org>
Wed, 3 Oct 2018 06:46:02 +0000 (08:46 +0200)
commit8ee10862476ef8b9e81e5b521205fd5c620b4ffb
tree1a84b111fdc5b1ce298da14c4b951be6e377f534
parent44318d5b07be7d7cfe718aa22ea3b2577361a0b5
locking/lockdep: Eliminate redundant IRQs check in __lock_acquire()

The static __lock_acquire() function has only two callers:

 1) lock_acquire()
 2) reacquire_held_locks()

In lock_acquire(), raw_local_irq_save() is called beforehand. So
IRQs must have been disabled. So the check:

DEBUG_LOCKS_WARN_ON(!irqs_disabled())

is kind of redundant in this case. So move the above check
to reacquire_held_locks() to eliminate redundant code in the
lock_acquire() path.

Signed-off-by: Waiman Long <longman@redhat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Link: http://lkml.kernel.org/r/1538511560-10090-3-git-send-email-longman@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/locking/lockdep.c