* qemu_cond_wait polling
@ 2009-07-28 7:16 Jan Kiszka
2009-07-28 9:18 ` Avi Kivity
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2009-07-28 7:16 UTC (permalink / raw)
To: qemu-devel, kvm-devel
[-- Attachment #1: Type: text/plain, Size: 279 bytes --]
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: qemu_cond_wait polling
2009-07-28 7:16 qemu_cond_wait polling Jan Kiszka
@ 2009-07-28 9:18 ` Avi Kivity
2009-07-28 9:32 ` [PATCH] qemu-kvm: Drop polling property from qemu_cond_wait Jan Kiszka
0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2009-07-28 9:18 UTC (permalink / raw)
To: Jan Kiszka; +Cc: qemu-devel, kvm-devel
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.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] qemu-kvm: Drop polling property from qemu_cond_wait
2009-07-28 9:18 ` Avi Kivity
@ 2009-07-28 9:32 ` Jan Kiszka
2009-08-03 11:59 ` Avi Kivity
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2009-07-28 9:32 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-devel
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;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-08-03 11:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-28 7:16 qemu_cond_wait polling Jan Kiszka
2009-07-28 9:18 ` Avi Kivity
2009-07-28 9:32 ` [PATCH] qemu-kvm: Drop polling property from qemu_cond_wait Jan Kiszka
2009-08-03 11:59 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox