Re: [Qemu-devel] [PATCH 11/19] use a bottom half to run timers

2010-01-05 Thread Paolo Bonzini
On 01/04/2010 08:38 PM, Jamie Lokier wrote: In principle, if it does affect something, it seems likely there is already a buggy race condition. After all, if the timer and bottom half could trigger at the same time, which is the condition where the order is significant, then in principle the tim

Re: [Qemu-devel] [PATCH 11/19] use a bottom half to run timers

2010-01-04 Thread Jamie Lokier
Anthony Liguori wrote: > introduces a subtle semantic change. Previously, timers always ran > before bottom halves whereas after this change, timers may run after > some bottoms halves but before others. While this should be okay in > principle, in practice, I'm sure it'll introduce regression

Re: [Qemu-devel] [PATCH 11/19] use a bottom half to run timers

2010-01-04 Thread Anthony Liguori
On 12/21/2009 02:09 AM, Paolo Bonzini wrote: Make the timer subsystem register its own bottom half instead of placing the bottom half code in the heart of the main loop. To test if an alarm timer is pending, just check if the bottom half is scheduled. Signed-off-by: Paolo Bonzini I'm not a hu

Re: [Qemu-devel] [PATCH 11/19] use a bottom half to run timers

2009-12-24 Thread Paolo Bonzini
On 12/24/2009 12:25 PM, Marcelo Tosatti wrote: /* rearm timer, if not periodic */ if (t->expired) { t->expired = 0; qemu_rearm_alarm_timer(t); } -> host_alarm_handler fires, sets bh->scheduled = 1 -> qemu_mod_timer sees qemu_alarm_pending() == true an

Re: [Qemu-devel] [PATCH 11/19] use a bottom half to run timers

2009-12-24 Thread Marcelo Tosatti
On Thu, Dec 24, 2009 at 11:27:06AM +0100, Paolo Bonzini wrote: > On 12/23/2009 07:37 PM, Marcelo Tosatti wrote: >> You should probably make sure the bh handling is signal safe. Perhaps >> use atomic test-and-set for bh->schedule on qemu_bh_poll, etc... > > The worst thing that can happen is that qe

Re: [Qemu-devel] [PATCH 11/19] use a bottom half to run timers

2009-12-24 Thread Paolo Bonzini
On 12/23/2009 07:37 PM, Marcelo Tosatti wrote: You should probably make sure the bh handling is signal safe. Perhaps use atomic test-and-set for bh->schedule on qemu_bh_poll, etc... The worst thing that can happen is that qemu_bh_poll misses the alarm bottom half, and tcg_cpu_exec exits immedi

Re: [Qemu-devel] [PATCH 11/19] use a bottom half to run timers

2009-12-23 Thread Marcelo Tosatti
On Mon, Dec 21, 2009 at 09:09:22AM +0100, Paolo Bonzini wrote: > Make the timer subsystem register its own bottom half instead of > placing the bottom half code in the heart of the main loop. To > test if an alarm timer is pending, just check if the bottom half is > scheduled. > > Signed-off-by:

[Qemu-devel] [PATCH 11/19] use a bottom half to run timers

2009-12-21 Thread Paolo Bonzini
Make the timer subsystem register its own bottom half instead of placing the bottom half code in the heart of the main loop. To test if an alarm timer is pending, just check if the bottom half is scheduled. Signed-off-by: Paolo Bonzini --- vl.c | 68 ---