Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux kernel dump: How to get the owner of a spinlock

I have a linux kernel dump generated on a 24-core system. Most of the tasks are stuck on a spinlock. Is there a way to get the owner of a spinlock?

like image 359
Alex Fiddler Avatar asked Oct 26 '25 00:10

Alex Fiddler


1 Answers

Spinlock doesn't have the concept of "owner", mutex has.

So actually what you want to know is which process is holding a specific spinlock. This kind of information is usually available in lockdep backtrace. So if you have lockdep enabled, you can just read the kernel log, if not, you need to check the backtraces of all processes, similar to Sysrq-t. Give the fact that you already have the vmcore, you can use crash utility to get the backtrace of each process.

like image 59
Cong Wang Avatar answered Oct 29 '25 02:10

Cong Wang