Skip to contentSkip to conversation

qemu_cond_wait polling

PATCH Applied Jan Kiszka 3 participants 4 messages Jul 28, 2009 – Aug 3, 2009 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

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?

Jan

#1 lore raw
Quoted 8 lines · Jan Kiszka

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.

Signature · 1 line
error compiling committee.c: too many arguments to function
#2 lore raw

PATCH 1/1 qemu-kvm: Drop polling property from qemu_cond_wait

Quoted 10 lines · Avi Kivity
Quoted 8 lines · Jan Kiszka

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?

Quoted 3 lines

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.

---

 qemu-kvm.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
qemu-kvm.c +1 -5
index 32dce4a..0615d06 100644
@@ -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;
 }
 
Applied
#3 lore raw

Re: [PATCH] qemu-kvm: Drop polling property from qemu_cond_wait

Quoted 4 lines · Jan Kiszka

No caller of qemu_cond_wait makes use of this polling anymore. Remove it.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function