You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add some measurements to determine the cost of the spinlock
variant that disable/enable interrupts, with save/restore flags.
This should help us determine:
1. How expensive is this compared to the basic spinlock,
2. is a "manual" save/restore before spinlock as expensive
or is there some advantage of the combined func call
Measured on my laptop CPU i7-2620M CPU @ 2.70GHz:
(kernel 3.17.8-200.fc20.x86_64)
* 12.775 ns - "clean" spin_lock_unlock
* 21.099 ns - irqsave variant spinlock
* 22.808 ns - "manual" irqsave before spin_lock
* 14.618 ns - "manual" local_irq_disable + spin_lock
The clean spin_lock_unlock is 8.324 ns faster than irqsave variant.
The irqsave variant is actually faster than expected, as the measurement
of an isolated local_irq_save_restore were 13.256 ns.
The difference to the "manual" irqsave is only 1.709 ns, which is approx
the cost of an extra function call.
If one can use the non-flags-save version of local_irq_disable, then one
can save 6.481 ns (on this specific CPU and kernel config).
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
0 commit comments