From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chen, Tiejun" Subject: Re: [[PATCH 2/2] kvm: enable preemption to register/unregister preempt notifier Date: Mon, 06 Jul 2015 08:46:07 +0800 Message-ID: <5599CFCF.7070301@intel.com> References: <1435913788-4300-1-git-send-email-tiejun.chen@intel.com> <1435913788-4300-2-git-send-email-tiejun.chen@intel.com> <559670B3.2000705@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, Gleb Natapov To: Paolo Bonzini , kvm@vger.kernel.org Return-path: Received: from mga02.intel.com ([134.134.136.20]:59425 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753107AbbGFAqL (ORCPT ); Sun, 5 Jul 2015 20:46:11 -0400 In-Reply-To: <559670B3.2000705@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2015/7/3 19:23, Paolo Bonzini wrote: > On 03/07/2015 10:56, Tiejun Chen wrote: >> After commit 1cde2930e154 ("sched/preempt: Add static_key() to >> preempt_notifiers") is introduced, preempt_notifier_{register, unregister} >> always hold a mutex, jump_label_mutex. So in current case this shouldn't >> work further under the circumstance of disabled preemption, and its also >> safe since we're just handling a per-vcpu stuff with holding vcpu->mutex. >> Otherwise, some warning messages are posted like this, >> >> BUG: scheduling while atomic: qemu-system-x86/17177/0x00000002 >> 2 locks held by qemu-system-x86/17177: >> #0: (&vcpu->mutex){+.+.+.}, at: [] vcpu_load+0x28/0xf0 [kvm] >> #1: (jump_label_mutex){+.+.+.}, at: [] static_key_slow_inc+0xc4/0x140 >> Modules linked in: x86_pkg_temp_thermal kvm_intel kvm >> Preemption disabled at:[] kvm_vcpu_ioctl+0x7e/0xeb0 [kvm] > > Thanks for your work Tiejun. However, the original patch is crap. I've > asked to revert it. > Yeah, its better to revert that commit since finally this also trigger a bug 100671: vmwrite error in vmx_vcpu_run. Thanks Tiejun