locking/lockdep, sched/core: Implement a better lock pinning scheme
authorPeter Zijlstra <peterz@infradead.org>
Sat, 1 Aug 2015 17:25:08 +0000 (19:25 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 5 May 2016 07:23:59 +0000 (09:23 +0200)
commite7904a28f5331c21d17af638cb477c83662e3cb6
tree4fd496dcdf41f61964125682664f57d50f3527e2
parenteb58075149b7f0300ff19142e6245fe75db2a081
locking/lockdep, sched/core: Implement a better lock pinning scheme

The problem with the existing lock pinning is that each pin is of
value 1; this mean you can simply unpin if you know its pinned,
without having any extra information.

This scheme generates a random (16 bit) cookie for each pin and
requires this same cookie to unpin. This means you have to keep the
cookie in context.

No objsize difference for !LOCKDEP kernels.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/lockdep.h
kernel/locking/lockdep.c
kernel/sched/core.c
kernel/sched/deadline.c
kernel/sched/fair.c
kernel/sched/idle_task.c
kernel/sched/rt.c
kernel/sched/sched.h
kernel/sched/stop_task.c