snu-csl / nvmevirt

NVMeVirt: A Versatile Software-defined Virtual NVMe Device
Other
182 stars 54 forks source link

Convert irq_lock to mutex #33

Closed arter97 closed 5 months ago

arter97 commented 7 months ago

MSI helper functions within the Linux kernel may try to catch mutex [1][2] while we hold a spinlock with preemption disabled.

Fixes: #30 Link: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/kernel/irq/msi.c?h=v6.6#n448 [1] Link: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/kernel/irq/msi.c?h=v6.6#n334 [2]

arter97 commented 7 months ago

Additionally, this lock specifically would go through the fastpath of mutex, so the performance should be identical to spin lock. My brief benchmark also doesn't show any performance difference.