From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [PATCH 04/37] Trigger exit from cpu_exec_all on pending IO events Date: Mon, 14 Feb 2011 13:22:33 -0200 Message-ID: <38145df24c55bffe8ba63cfa28173c9ddd5a2c2d.1297696986.git.mtosatti@redhat.com> References: Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Jan Kiszka , Marcelo Tosatti To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:2651 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755738Ab1BNPZF (ORCPT ); Mon, 14 Feb 2011 10:25:05 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: From: Jan Kiszka Except for timer events, we currently do not leave the loop over all VCPUs if an IO event was filed. That may cause unexpected IO latencies under !CONFIG_IOTHREAD in SMP scenarios. Fix it by setting the global exit_request which breaks the loop. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- cpus.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/cpus.c b/cpus.c index f8a88e3..0abc009 100644 --- a/cpus.c +++ b/cpus.c @@ -307,6 +307,7 @@ void qemu_notify_event(void) if (next_cpu && env != next_cpu) { cpu_exit(next_cpu); } + exit_request = 1; } void qemu_mutex_lock_iothread(void) {} -- 1.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58090 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pp0IY-0000Jm-AE for qemu-devel@nongnu.org; Mon, 14 Feb 2011 10:25:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pp0IL-000412-GJ for qemu-devel@nongnu.org; Mon, 14 Feb 2011 10:25:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pp0IK-0003zw-Vh for qemu-devel@nongnu.org; Mon, 14 Feb 2011 10:24:57 -0500 From: Marcelo Tosatti Date: Mon, 14 Feb 2011 13:22:33 -0200 Message-Id: <38145df24c55bffe8ba63cfa28173c9ddd5a2c2d.1297696986.git.mtosatti@redhat.com> In-Reply-To: References: Subject: [Qemu-devel] [PATCH 04/37] Trigger exit from cpu_exec_all on pending IO events List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org From: Jan Kiszka Except for timer events, we currently do not leave the loop over all VCPUs if an IO event was filed. That may cause unexpected IO latencies under !CONFIG_IOTHREAD in SMP scenarios. Fix it by setting the global exit_request which breaks the loop. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- cpus.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/cpus.c b/cpus.c index f8a88e3..0abc009 100644 --- a/cpus.c +++ b/cpus.c @@ -307,6 +307,7 @@ void qemu_notify_event(void) if (next_cpu && env != next_cpu) { cpu_exit(next_cpu); } + exit_request = 1; } void qemu_mutex_lock_iothread(void) {} -- 1.7.4