From patchwork Tue Jul 28 09:32:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 37687 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 n6S9Wl9Q002668 for ; Tue, 28 Jul 2009 09:32:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751429AbZG1Jco (ORCPT ); Tue, 28 Jul 2009 05:32:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751382AbZG1Jco (ORCPT ); Tue, 28 Jul 2009 05:32:44 -0400 Received: from thoth.sbs.de ([192.35.17.2]:23677 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751378AbZG1Jcn (ORCPT ); Tue, 28 Jul 2009 05:32:43 -0400 Received: from mail2.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n6S9WNrg017267; Tue, 28 Jul 2009 11:32:23 +0200 Received: from [139.25.109.167] (mchn012c.ww002.siemens.net [139.25.109.167] (may be forged)) by mail2.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id n6S9WMqk008997; Tue, 28 Jul 2009 11:32:23 +0200 Message-ID: <4A6EC5A5.8070009@siemens.com> Date: Tue, 28 Jul 2009 11:32:21 +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: Avi Kivity CC: kvm-devel Subject: [PATCH] qemu-kvm: Drop polling property from qemu_cond_wait References: <4A6EA5B3.6090500@web.de> <4A6EC26A.4070306@redhat.com> In-Reply-To: <4A6EC26A.4070306@redhat.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Avi Kivity wrote: > On 07/28/2009 10:16 AM, Jan Kiszka wrote: >> Hi, >> >> why do we wait on condition variables with silly timeouts (both in >> upstream as in qemu-kvm)? There used to be some qemu_aio_poll in >> qemu-kvm, but it's no longer there, and upstream never had (unless I >> missed something). Is this polling legacy now? Remove it? >> >> > > Given that all uses are inside while loops, the timeouts are ignored. > It's completely pointless now. > Then let's start with removing it from qemu-kvm: ------------> No caller of qemu_cond_wait makes use of this polling anymore. Remove it. Signed-off-by: Jan Kiszka --- qemu-kvm.c | 6 +----- 1 files changed, 1 insertions(+), 5 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/qemu-kvm.c b/qemu-kvm.c index 32dce4a..0615d06 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1557,12 +1557,8 @@ static inline unsigned long kvm_get_thread_id(void) static void qemu_cond_wait(pthread_cond_t *cond) { CPUState *env = cpu_single_env; - static const struct timespec ts = { - .tv_sec = 0, - .tv_nsec = 100000, - }; - pthread_cond_timedwait(cond, &qemu_mutex, &ts); + pthread_cond_wait(cond, &qemu_mutex); cpu_single_env = env; }