Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751602AbbFYMPp (ORCPT ); Thu, 25 Jun 2015 08:15:45 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:36147 "EHLO mail-lb0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbbFYMPh (ORCPT ); Thu, 25 Jun 2015 08:15:37 -0400 Message-ID: <558BF0E4.50602@gmail.com> Date: Thu, 25 Jun 2015 14:15:32 +0200 From: Pontus Fuchs User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Peter Zijlstra CC: mingo@redhat.com, "linux-kernel@vger.kernel.org" , gleb@kernel.org Subject: Re: Regression: sched/preempt: Add static_key() to preempt_notifiers breaks my KVM References: <558BED42.1030000@gmail.com> <20150625120949.GZ3644@twins.programming.kicks-ass.net> In-Reply-To: <20150625120949.GZ3644@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1267 Lines: 47 On 2015-06-25 14:09, Peter Zijlstra wrote: > On Thu, Jun 25, 2015 at 02:00:02PM +0200, Pontus Fuchs wrote: >> Hi, >> > > That seems pointless.. > > --- > virt/kvm/kvm_main.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 90977418aeb6..d7aafa0458a0 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -128,8 +128,9 @@ int vcpu_load(struct kvm_vcpu *vcpu) > > if (mutex_lock_killable(&vcpu->mutex)) > return -EINTR; > - cpu = get_cpu(); > preempt_notifier_register(&vcpu->preempt_notifier); > + > + cpu = get_cpu(); > kvm_arch_vcpu_load(vcpu, cpu); > put_cpu(); > return 0; > @@ -139,8 +140,8 @@ void vcpu_put(struct kvm_vcpu *vcpu) > { > preempt_disable(); > kvm_arch_vcpu_put(vcpu); > - preempt_notifier_unregister(&vcpu->preempt_notifier); > preempt_enable(); > + preempt_notifier_unregister(&vcpu->preempt_notifier); > mutex_unlock(&vcpu->mutex); > } Tested ok. Thanks. BR, Pontus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/