From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: [PATCH] qemu-kvm: Drop polling property from qemu_cond_wait Date: Tue, 28 Jul 2009 11:32:21 +0200 Message-ID: <4A6EC5A5.8070009@siemens.com> References: <4A6EA5B3.6090500@web.de> <4A6EC26A.4070306@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Avi Kivity Return-path: 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 In-Reply-To: <4A6EC26A.4070306@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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(-) 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; }