From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergey Senozhatsky Date: Fri, 04 Jun 2021 09:22:02 +0000 Subject: Re: [RFC][PATCH] kvm: add suspend pm-notifier Message-Id: List-Id: References: <20210603164315.682994-1-senozhatsky@chromium.org> <87a6o614dn.fsf@vitty.brq.redhat.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Paolo Bonzini Cc: Vitaly Kuznetsov , Sergey Senozhatsky , Marc Zyngier , Huacai Chen , Paul Mackerras , Christian Borntraeger , Suleiman Souhlal , x86@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-s390@vger.kernel.org, Sean Christopherson , Jim Mattson On (21/06/04 09:24), Paolo Bonzini wrote: > On 04/06/21 09:21, Vitaly Kuznetsov wrote: > > > preempt_notifier_inc(); > > > + kvm_init_pm_notifier(kvm); > > You've probably thought it through and I didn't but wouldn't it be > > easier to have one global pm_notifier call for KVM which would go > > through the list of VMs instead of registering/deregistering a > > pm_notifier call for every created/destroyed VM? > > That raises questions on the locking, i.e. if we can we take the kvm_lock > safely from the notifier. Right, I wanted to take the VM lock, rather than subsystem lock (kvm_lock).