Vetter: Locking Engineering Principles

Post Syndicated from original https://lwn.net/Articles/902645/

Daniel Vetter offers some
advice
for developers of locking schemes in the kernel.

Validating locking by hand against all the other locking designs
and nesting rules the kernel has overall is nigh impossible,
extremely slow, something only few people can do with any chance of
success and hence in almost all cases a complete waste of time. We
need tools to automate this, and in the Linux kernel this is
lockdep.

Therefore if lockdep doesn’t understand your locking design your
design is at fault, not lockdep. Adjust accordingly.