[<prev] [next>] [day] [month] [year] [list]
Message-ID: <b63a373a-be17-33ca-11f6-2dd36162844b@redhat.com>
Date: Fri, 29 Apr 2022 15:44:42 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Hillf Danton <hdanton@...a.com>
Cc: Peter Gonda <pgonda@...gle.com>,
Sean Christopherson <seanjc@...gle.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] KVM: SEV: Mark nested locking of vcpu->lock
On 4/29/22 13:40, Hillf Danton wrote:
> To avoid acquiring more than one mutexes at the same time, add a completion
> in paralle to the mutex in question and ask mutex locker for non-migration
> purpose to take a nap on completion instead of mutex.
Acquiring more than one mutex at a time is perfectly fine. It also
cannot get into philosophers-problem-like deadlocks because 1) it's got
a well-defined iteration order 2) it's protected by sev_lock_two_vms.
Just, lockdep that has to be convinced that it is fine. I don't shy
away from complex locking schemes if they're necessary, but here it
absolutely isn't.
Paolo
Powered by blists - more mailing lists