Protect active_timers[] lists with mutexes so timers can be safely used from different threads. Signed-off-by: Ben Guthro <bguthro@vrtualiron.com> Signed-off-by: Gary Grebus <ggrebus@virtualiron.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Daniel P. Berrange
2007-Aug-27 19:32 UTC
Re: [Xen-devel] [PATCH][QEMU] Make active-timers thread-safe
On Mon, Aug 27, 2007 at 02:58:26PM -0400, Ben Guthro wrote:> Protect active_timers[] lists with mutexes so timers can be safely used > from different threads.What code in QEMU is actually still using threads ? There used to be a Xen specific patch to the IDE layer to perform DMA ops in threads, but that was removed when xen-unstable synced with QEMU 0.9.0. Not aware of anything else using threads in the QEMU device model - its pretty dangerous because QEMU''s internal data structures basically all assume single-threaded access. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ben Guthro
2007-Aug-28 11:18 UTC
Re: [Xen-devel] [PATCH][QEMU] Make active-timers thread-safe
After speaking with the original developer of this patch, it may have been a mistake to port it forward from the 3.1 codebase. This submission was premature. We will do some investigation to see if this is still a problem in unstable. Apologies, Ben Daniel P. Berrange wrote:> On Mon, Aug 27, 2007 at 02:58:26PM -0400, Ben Guthro wrote: > >> Protect active_timers[] lists with mutexes so timers can be safely used >> from different threads. >> > > What code in QEMU is actually still using threads ? There used to be a Xen > specific patch to the IDE layer to perform DMA ops in threads, but that was > removed when xen-unstable synced with QEMU 0.9.0. Not aware of anything > else using threads in the QEMU device model - its pretty dangerous because > QEMU''s internal data structures basically all assume single-threaded access. > > Regards, > Dan. >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dave Lively
2007-Aug-29 19:36 UTC
Re: [Xen-devel] [PATCH][QEMU] Make active-timers thread-safe
Hi Daniel - While I agree this patch wasn''t necessary, I was curious why it was even compiling for us (it was "auto-ported" to our unstable tree without human intervention) since the patch introduces uses of pthread data structures but doesn''t introduce an include of <pthread.h>. I notice tools/ioemu/vl.h is still including <pthread.h> for i386/x86_64 to implement a mapcache lock. Isn''t this now unnecessary for the same reason? Dave On 8/27/07, Daniel P. Berrange <berrange@redhat.com> wrote:> On Mon, Aug 27, 2007 at 02:58:26PM -0400, Ben Guthro wrote: > > Protect active_timers[] lists with mutexes so timers can be safely used > > from different threads. > > What code in QEMU is actually still using threads ? There used to be a Xen > specific patch to the IDE layer to perform DMA ops in threads, but that was > removed when xen-unstable synced with QEMU 0.9.0. Not aware of anything > else using threads in the QEMU device model - its pretty dangerous because > QEMU''s internal data structures basically all assume single-threaded access. > > Regards, > Dan. > -- > |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| > |=- Perl modules: http://search.cpan.org/~danberr/ -=| > |=- Projects: http://freshmeat.net/~danielpb/ -=| > |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel