* [Qemu-devel] [5636] Run timers from host alarm timer callback
@ 2008-11-05 21:04 Anthony Liguori
2008-11-05 21:08 ` Anthony Liguori
0 siblings, 1 reply; 7+ messages in thread
From: Anthony Liguori @ 2008-11-05 21:04 UTC (permalink / raw)
To: qemu-devel
Revision: 5636
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5636
Author: aliguori
Date: 2008-11-05 21:04:35 +0000 (Wed, 05 Nov 2008)
Log Message:
-----------
Run timers from host alarm timer callback
This further cleans up the main loop getting it a lot closer to what a main
loop should be.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/vl.c
Modified: trunk/vl.c
===================================================================
--- trunk/vl.c 2008-11-05 20:49:37 UTC (rev 5635)
+++ trunk/vl.c 2008-11-05 21:04:35 UTC (rev 5636)
@@ -1700,6 +1700,15 @@
len = read(alarm_timer_rfd, buffer, sizeof(buffer));
} while ((len == -1 && errno == EINTR) || len > 0);
+ /* vm time timers */
+ if (vm_running && likely(!(cur_cpu->singlestep_enabled & SSTEP_NOTIMER)))
+ qemu_run_timers(&active_timers[QEMU_TIMER_VIRTUAL],
+ qemu_get_clock(vm_clock));
+
+ /* real time timers */
+ qemu_run_timers(&active_timers[QEMU_TIMER_REALTIME],
+ qemu_get_clock(rt_clock));
+
if (t->flags & ALARM_FLAG_EXPIRED) {
alarm_timer->flags &= ~ALARM_FLAG_EXPIRED;
qemu_rearm_alarm_timer(alarm_timer);
@@ -4551,16 +4560,6 @@
}
#endif
- if (vm_running) {
- if (likely(!(cur_cpu->singlestep_enabled & SSTEP_NOTIMER)))
- qemu_run_timers(&active_timers[QEMU_TIMER_VIRTUAL],
- qemu_get_clock(vm_clock));
- }
-
- /* real time timers */
- qemu_run_timers(&active_timers[QEMU_TIMER_REALTIME],
- qemu_get_clock(rt_clock));
-
/* Check bottom-halves last in case any of the earlier events triggered
them. */
qemu_bh_poll();
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [5636] Run timers from host alarm timer callback
2008-11-05 21:04 [Qemu-devel] [5636] Run timers from host alarm timer callback Anthony Liguori
@ 2008-11-05 21:08 ` Anthony Liguori
2008-11-07 11:52 ` Luis Pureza
0 siblings, 1 reply; 7+ messages in thread
From: Anthony Liguori @ 2008-11-05 21:08 UTC (permalink / raw)
To: qemu-devel
Anthony Liguori wrote:
> Revision: 5636
> http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5636
> Author: aliguori
> Date: 2008-11-05 21:04:35 +0000 (Wed, 05 Nov 2008)
>
> Log Message:
> -----------
> Run timers from host alarm timer callback
>
> This further cleans up the main loop getting it a lot closer to what a main
> loop should be.
>
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>
I've tested this with a variety of clocks and guests but this could
uncover more bugs like the previous 5s select sleep. If things start
slowing down, please try this changeset first and let me know.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [5636] Run timers from host alarm timer callback
2008-11-05 21:08 ` Anthony Liguori
@ 2008-11-07 11:52 ` Luis Pureza
2008-11-07 14:06 ` Anthony Liguori
0 siblings, 1 reply; 7+ messages in thread
From: Luis Pureza @ 2008-11-07 11:52 UTC (permalink / raw)
To: qemu-devel
Hi,
This commit caused a noticeable slowdown while using the instruction
counting mechanism. I'm testing with the sparc-test image and with
--icount auto.
Any ideas?
Thanks,
Luís Pureza
On Wed, Nov 5, 2008 at 9:08 PM, Anthony Liguori <anthony@codemonkey.ws> wrote:
> Anthony Liguori wrote:
>>
>> Revision: 5636
>> http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5636
>> Author: aliguori
>> Date: 2008-11-05 21:04:35 +0000 (Wed, 05 Nov 2008)
>>
>> Log Message:
>> -----------
>> Run timers from host alarm timer callback
>>
>> This further cleans up the main loop getting it a lot closer to what a
>> main
>> loop should be.
>>
>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>
>
> I've tested this with a variety of clocks and guests but this could uncover
> more bugs like the previous 5s select sleep. If things start slowing down,
> please try this changeset first and let me know.
>
> Regards,
>
> Anthony Liguori
>
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [5636] Run timers from host alarm timer callback
2008-11-07 11:52 ` Luis Pureza
@ 2008-11-07 14:06 ` Anthony Liguori
2008-11-07 16:23 ` Paul Brook
2008-11-11 21:00 ` Anthony Liguori
0 siblings, 2 replies; 7+ messages in thread
From: Anthony Liguori @ 2008-11-07 14:06 UTC (permalink / raw)
To: qemu-devel
Luis Pureza wrote:
> Hi,
>
> This commit caused a noticeable slowdown while using the instruction
> counting mechanism. I'm testing with the sparc-test image and with
> --icount auto.
>
Yeah, I take it that all timers don't result in signals when using
icount and that we rely on select() timeout instead. Let me look a
little more closely at the code and I'll come up with a fix.
Regards,
Anthony Liguori
> Any ideas?
>
> Thanks,
>
> Luís Pureza
>
> On Wed, Nov 5, 2008 at 9:08 PM, Anthony Liguori <anthony@codemonkey.ws> wrote:
>
>> Anthony Liguori wrote:
>>
>>> Revision: 5636
>>> http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5636
>>> Author: aliguori
>>> Date: 2008-11-05 21:04:35 +0000 (Wed, 05 Nov 2008)
>>>
>>> Log Message:
>>> -----------
>>> Run timers from host alarm timer callback
>>>
>>> This further cleans up the main loop getting it a lot closer to what a
>>> main
>>> loop should be.
>>>
>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>>
>>>
>> I've tested this with a variety of clocks and guests but this could uncover
>> more bugs like the previous 5s select sleep. If things start slowing down,
>> please try this changeset first and let me know.
>>
>> Regards,
>>
>> Anthony Liguori
>>
>>
>>
>>
>>
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [5636] Run timers from host alarm timer callback
2008-11-07 14:06 ` Anthony Liguori
@ 2008-11-07 16:23 ` Paul Brook
2008-11-11 21:00 ` Anthony Liguori
1 sibling, 0 replies; 7+ messages in thread
From: Paul Brook @ 2008-11-07 16:23 UTC (permalink / raw)
To: qemu-devel
On Friday 07 November 2008, Anthony Liguori wrote:
> Luis Pureza wrote:
> > Hi,
> >
> > This commit caused a noticeable slowdown while using the instruction
> > counting mechanism. I'm testing with the sparc-test image and with
> > --icount auto.
>
> Yeah, I take it that all timers don't result in signals when using
> icount and that we rely on select() timeout instead. Let me look a
> little more closely at the code and I'll come up with a fix.
In icount mode vm_clock timers don't use host timers at all.
Instead we calculate how long we want to wait before checking again (the
EXCP_HALT code in vl.c:main_loop), and use that as the select timeout.
Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [5636] Run timers from host alarm timer callback
2008-11-07 14:06 ` Anthony Liguori
2008-11-07 16:23 ` Paul Brook
@ 2008-11-11 21:00 ` Anthony Liguori
2008-11-11 23:42 ` Luis Pureza
1 sibling, 1 reply; 7+ messages in thread
From: Anthony Liguori @ 2008-11-11 21:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Luis Pureza
Anthony Liguori wrote:
> Luis Pureza wrote:
>> Hi,
>>
>> This commit caused a noticeable slowdown while using the instruction
>> counting mechanism. I'm testing with the sparc-test image and with
>> --icount auto.
>>
>
> Yeah, I take it that all timers don't result in signals when using
> icount and that we rely on select() timeout instead. Let me look a
> little more closely at the code and I'll come up with a fix.
Did r5623 happen to fix this problem?
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [5636] Run timers from host alarm timer callback
2008-11-11 21:00 ` Anthony Liguori
@ 2008-11-11 23:42 ` Luis Pureza
0 siblings, 0 replies; 7+ messages in thread
From: Luis Pureza @ 2008-11-11 23:42 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel
On Tue, Nov 11, 2008 at 9:00 PM, Anthony Liguori <anthony@codemonkey.ws> wrote:
> Anthony Liguori wrote:
> Did r5623 happen to fix this problem?
Sorry, no. Should it?
Luís Pureza
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-11-11 23:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-05 21:04 [Qemu-devel] [5636] Run timers from host alarm timer callback Anthony Liguori
2008-11-05 21:08 ` Anthony Liguori
2008-11-07 11:52 ` Luis Pureza
2008-11-07 14:06 ` Anthony Liguori
2008-11-07 16:23 ` Paul Brook
2008-11-11 21:00 ` Anthony Liguori
2008-11-11 23:42 ` Luis Pureza
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).