From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Ehrhardt Date: Mon, 04 Oct 2010 05:22:14 +0000 Subject: Re: [PATCH] kvmppc_init_timing_stats: fix sleep with interrupts disabled Message-Id: <4CA96486.4050004@linux.vnet.ibm.com> List-Id: References: <20100930192850.GA16941@udp111988uds.am.freescale.net> In-Reply-To: <20100930192850.GA16941@udp111988uds.am.freescale.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: kvm-ppc@vger.kernel.org On 10/01/2010 12:07 AM, Alexander Graf wrote: > > On 30.09.2010, at 21:28, Scott Wood wrote: > >> It is not legal to call mutex_lock() with interrupts disabled. >> This will assert with debug checks enabled. >> >> If there's a real need to disable interrupts here, it could be done >> after the mutex is acquired -- but I don't see why it's needed at all. > > Christian, IIRC this code is yours. Any comments? Yes, It should be save to drop the irq_disable. IIRC it was without the lock in early stages of development (pre=20 upstream git, so you can't see it) which had some obvious races. But the lock makes it mutually exclusive per vcpu and should ensure it=20 isn't running - by that it should be fine. Reviewed-by: Christian Ehrhardt > Alex > >> >> Signed-off-by: Scott Wood >> --- >> arch/powerpc/kvm/timing.c | 2 -- >> 1 files changed, 0 insertions(+), 2 deletions(-) >> >> diff --git a/arch/powerpc/kvm/timing.c b/arch/powerpc/kvm/timing.c >> index 46fa04f..a021f58 100644 >> --- a/arch/powerpc/kvm/timing.c >> +++ b/arch/powerpc/kvm/timing.c >> @@ -35,7 +35,6 @@ void kvmppc_init_timing_stats(struct kvm_vcpu *vcpu) >> int i; >> >> /* pause guest execution to avoid concurrent updates */ >> - local_irq_disable(); >> mutex_lock(&vcpu->mutex); >> >> vcpu->arch.last_exit_type =3D 0xDEAD; >> @@ -51,7 +50,6 @@ void kvmppc_init_timing_stats(struct kvm_vcpu *vcpu) >> vcpu->arch.timing_last_enter.tv64 =3D 0; >> >> mutex_unlock(&vcpu->mutex); >> - local_irq_enable(); >> } >> >> static void add_exit_timing(struct kvm_vcpu *vcpu, u64 duration, int typ= e) >> -- >> 1.7.0.4 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > --=20 Gr=FCsse / regards, Christian Ehrhardt IBM Linux Technology Center, System z Linux Performance