Re: [PATCH v3] KVM: x86: Keep the lock order consistent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 08, 2022, Hao Peng wrote:
> From: Peng Hao <flyingpeng@xxxxxxxxxxx>
> 
> Acquire SRCU before taking the gpc spinlock in wait_pending_event() so as
> to be consistent with all other functions that acquire both locks.  It's
> not illegal to acquire SRCU inside a spinlock, nor is there deadlock
> potential, but in general it's preferable to order locks from least
> restrictive to most restrictive, e.g. if wait_pending_event() needed to
> sleep for whatever reason, it could do so while holding SRCU, but would
> need to drop the spinlock.
> 
> Thanks Sean Christopherson for the comment.
> 
> Signed-off-by: Peng Hao <flyingpeng@xxxxxxxxxxx>
> Reviewed-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> ---

Merged to kvm/queue, thanks!

https://lore.kernel.org/all/Y4lHxds8pvBhxXFX@xxxxxxxxxx



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux