From patchwork Mon Jul 20 09:30:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 36290 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6K9Udfi027008 for ; Mon, 20 Jul 2009 09:30:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753081AbZGTJah (ORCPT ); Mon, 20 Jul 2009 05:30:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753086AbZGTJah (ORCPT ); Mon, 20 Jul 2009 05:30:37 -0400 Received: from gecko.sbs.de ([194.138.37.40]:18862 "EHLO gecko.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753077AbZGTJah (ORCPT ); Mon, 20 Jul 2009 05:30:37 -0400 Received: from mail1.sbs.de (localhost [127.0.0.1]) by gecko.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n6K9UDGF001955; Mon, 20 Jul 2009 11:30:19 +0200 Received: from [139.25.109.167] (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail1.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n6K9UCXq012077; Mon, 20 Jul 2009 11:30:13 +0200 Message-ID: <4A643924.6060908@siemens.com> Date: Mon, 20 Jul 2009 11:30:12 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Marcelo Tosatti CC: kvm-devel Subject: [PATCH] kvm: Drop obsolete cpu_get/put in make_all_cpus_request Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org spin_lock disables preemption, so we can simply read the current cpu. Signed-off-by: Jan Kiszka --- virt/kvm/kvm_main.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 7cd1c10..98e4ec8 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -741,8 +741,8 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req) if (alloc_cpumask_var(&cpus, GFP_ATOMIC)) cpumask_clear(cpus); - me = get_cpu(); spin_lock(&kvm->requests_lock); + me = smp_processor_id(); kvm_for_each_vcpu(i, vcpu, kvm) { if (test_and_set_bit(req, &vcpu->requests)) continue; @@ -757,7 +757,6 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req) else called = false; spin_unlock(&kvm->requests_lock); - put_cpu(); free_cpumask_var(cpus); return called; }