public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>
Subject: [PATCH] qemu-kvm: Drop polling property from qemu_cond_wait
Date: Tue, 28 Jul 2009 11:32:21 +0200	[thread overview]
Message-ID: <4A6EC5A5.8070009@siemens.com> (raw)
In-Reply-To: <4A6EC26A.4070306@redhat.com>

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 <jan.kiszka@siemens.com>
---

 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;
 }
 


  reply	other threads:[~2009-07-28  9:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28  7:16 qemu_cond_wait polling Jan Kiszka
2009-07-28  9:18 ` Avi Kivity
2009-07-28  9:32   ` Jan Kiszka [this message]
2009-08-03 11:59     ` [PATCH] qemu-kvm: Drop polling property from qemu_cond_wait Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A6EC5A5.8070009@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox