From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753196AbdATQo1 (ORCPT ); Fri, 20 Jan 2017 11:44:27 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:33135 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752663AbdATQo0 (ORCPT ); Fri, 20 Jan 2017 11:44:26 -0500 Date: Fri, 20 Jan 2017 17:44:23 +0100 From: Sebastian Andrzej Siewior To: Mike Galbraith Cc: Thomas Gleixner , LKML , linux-rt-users , Steven Rostedt Subject: Re: [patch-rt] kvm: Convert pvclock_gtod_sync_lock to raw_spinlock_t Message-ID: <20170120164423.iunwa3hntguswabj@linutronix.de> References: <20161223163213.szj43nv7rnelkbty@linutronix.de> <1482735248.4476.58.camel@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1482735248.4476.58.camel@gmx.de> User-Agent: NeoMutt/20161126 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016-12-26 07:54:08 [+0100], Mike Galbraith wrote: Not so sure about it. > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -1540,7 +1540,7 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu > kvm_vcpu_write_tsc_offset(vcpu, offset); > raw_spin_unlock_irqrestore(&kvm->arch.tsc_write_lock, flags); > > - spin_lock(&kvm->arch.pvclock_gtod_sync_lock); > + raw_spin_lock(&kvm->arch.pvclock_gtod_sync_lock); > if (!matched) { > kvm->arch.nr_vcpus_matched_tsc = 0; > } else if (!already_matched) { > @@ -1548,7 +1548,7 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu > } > > kvm_track_tsc_matching(vcpu); > - spin_unlock(&kvm->arch.pvclock_gtod_sync_lock); > + raw_spin_unlock(&kvm->arch.pvclock_gtod_sync_lock); > } > > EXPORT_SYMBOL_GPL(kvm_write_tsc); > @@ -1715,7 +1715,7 @@ static void kvm_gen_update_masterclock(s > struct kvm_vcpu *vcpu; > struct kvm_arch *ka = &kvm->arch; > > - spin_lock(&ka->pvclock_gtod_sync_lock); > + raw_spin_lock(&ka->pvclock_gtod_sync_lock); > kvm_make_mclock_inprogress_request(kvm); kvm_make_mclock_inprogress_request() will do zalloc_cpumask_var(). off-stack zalloc is not yet working but I would like to enable it. Also it does a SMP function call. Couldn't we go the other way around and drop the local_irq_disable()? Sebastian