Lock debugging within the kernel
As we’ve learned, locking and synchronization design and implementation can tend to become complex, thus increasing the chances of lurking bugs. The kernel has several means to help debug these difficult situations regarding kernel-level locking issues, deadlock being a primary one.
Just in case you haven’t already, do ensure you’ve first read the basics on synchronization, locking, and deadlock guidelines from the previous chapter (Chapter 12, Kernel Synchronization – Part 1, especially the Critical sections, exclusive execution, and atomicity and Concurrency concerns within the Linux kernel sections).
With any debug scenario, there are different points at which debugging occurs, and thus, perhaps differing tools and techniques that could/should be used. Very broadly speaking, a bug might be noticed, and thus debugged, at a few different points in time (within the Software Development Life Cycle (SDLC...