The Linux SMP kernel uses spinlocks to protect data structures from concurrent, potentially conflicting accesses. This patch allows you to build a kernel that can perform simple "metering", or record-keeping, of spinlock usage. Also available is source for an associated new command, lockstat, that is used to instruct the kernel to turn this lock metering on or off, retrieve the metering data from the kernel, and display it in a human-readable format.