From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: don't sent IPI if the vcpu is not online Date: Mon, 06 Sep 2010 08:46:07 +0300 Message-ID: <4C84801F.9060803@redhat.com> References: <4C807593.1050903@cn.fujitsu.com> <4C83445B.4020103@redhat.com> <4C844887.9090802@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , LKML , KVM , Alexander Graf To: Xiao Guangrong Return-path: Received: from mx1.redhat.com ([209.132.183.28]:12044 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982Ab0IFFqU (ORCPT ); Mon, 6 Sep 2010 01:46:20 -0400 In-Reply-To: <4C844887.9090802@cn.fujitsu.com> Sender: kvm-owner@vger.kernel.org List-ID: On 09/06/2010 04:48 AM, Xiao Guangrong wrote: > On 09/05/2010 03:18 PM, Avi Kivity wrote: >> On 09/03/2010 07:12 AM, Xiao Guangrong wrote: >>> It's no need sent IPI to the vcpu which is schedule out >>> >>> >>> @@ -86,6 +86,7 @@ struct kvm_vcpu { >>> unsigned long requests; >>> unsigned long guest_debug; >>> int srcu_idx; >>> + bool online; >> Why not check for guest_mode instead? >> > Oh, i forget it...but 'vcpu->guest_mode' is only used in x86 platform, > and make_all_cpus_request() is a common function. We can have a function kvm_vcpu_guest_mode() that is defined differently for x86 and the other. > So, maybe it's better use 'vcpu->online' here, and move 'guest_mode' into > 'vcpu->arch' ? I think guest_mode makes sense for the other archs for reducing IPIs, so let's leave it common and recommend that they implement it. Alex, if you're ever bored. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.