[PATCH] riscv: qspinlock: Add virt_spin_lock() support for KVM guests

Radim Krčmář rkrcmar at ventanamicro.com
Mon Dec 16 01:47:21 PST 2024


2024-12-15T11:13:22-0500, guoren at kernel.org:
> Add a static key controlling whether virt_spin_lock() should be
> called or not. When running on bare metal set the new key to
> false.

Wouldn't re-using the combo spinlock qspinlock_key be better?

> The VM guests should fall back to a Test-and-Set spinlock,
> because fair locks have horrible lock 'holder' preemption issues.
> The virt_spin_lock_key would shortcut for the queued_spin_lock_-
> slowpath() function that allow virt_spin_lock to hijack it.

I think we want the proper paravirtualized slowpath, have the
discussions stalled on the SBI side?

Btw. how bad are the performance numbers without this patch?

Thanks.



More information about the linux-riscv mailing list