Poor reporting perf , not the cycles consumed by _spin_unlock_irqrestore .
When IRQs are disabled, perforated interrupts are not processed. Instead, they are processed when interrupts are re-enabled. When the persistent interrupt handler looks at the instruction pointer to see which code has been run, it finds a function that allows interrupts - often this is _spin_unlock_irqrestore .
So, all you know is that the loops were destroyed by code that disabled interrupts and turned them on using _spin_unlock_irqrestore .
If you can force perf to use NMI (non-maskable interrupt), this can solve this problem.
I know that this can be done using oprofile (the predecessor) by changing the makefile, but I don't know about perf.
source share