From: Avi Kivity Subject: [PATCH QEMU-KVM 6/7] test: Add ipi_halt benchmark Date: Mon, 21 Sep 2009 11:55:37 +0300 Message-ID: <1253523338-22784-7-git-send-email-avi@redhat.com> References: <1253523338-22784-1-git-send-email-avi@redhat.com> Cc: Marcelo Tosatti To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:49627 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755454AbZIUIzj (ORCPT ); Mon, 21 Sep 2009 04:55:39 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8L8thYH029958 for ; Mon, 21 Sep 2009 04:55:43 -0400 In-Reply-To: <1253523338-22784-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Wait for 2000 cycles after the IPI to allow the host to schedule out. Measures wake-from-idle overhead. Signed-off-by: Avi Kivity --- kvm/user/test/x86/vmexit.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/vmexit.c b/kvm/user/test/x86/vmexit.c index 29bb32a..5088dc9 100644 --- a/kvm/user/test/x86/vmexit.c +++ b/kvm/user/test/x86/vmexit.c @@ -66,6 +66,16 @@ static void ipi(void) on_cpu(1, nop, 0); } +static void ipi_halt(void) +{ + unsigned long long t; + + on_cpu(1, nop, 0); + t = rdtsc() + 2000; + while (rdtsc() < t) + ; +} + static struct test { void (*func)(void); const char *name; @@ -76,6 +86,7 @@ static struct test { { mov_from_cr8, "mov_from_cr8" }, { mov_to_cr8, "mov_to_cr8" }, { ipi, "ipi", is_smp }, + { ipi_halt, "ipi+halt", is_smp }, }; static void do_test(struct test *test) -- 1.6.4.1