Spinlock and rw-lock debugging: basic checks

modulename: spinlock.ko

and/or

spinlock_debug.ko

configname: CONFIG_DEBUG_SPINLOCK

Linux Kernel Configuration
└─>Spinlock and rw-lock debugging: basic checks
In linux kernel since version 2.6.12  
Say Y here and build SMP to catch missing spinlock initialization
and certain other kinds of spinlock errors commonly made. This is
best used in conjunction with the NMI watchdog so that spinlock
deadlocks are also debuggable.

source code: