qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] thread-pool.c race condition?
@ 2015-04-02 16:26 Stefan Hajnoczi
  2015-04-02 16:43 ` Paolo Bonzini
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Hajnoczi @ 2015-04-02 16:26 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: John Snow, qemu-devel

John Snow has reported that qemu-io can hang when the host is under
heavy load.  He made the following observations in gdb:

1. The program is sitting in aio_poll() (called by bdrv_prwv_co())
waiting for request completion.

2. The thread pool has a ThreadPoolElement with ->state == THREAD_DONE.

The ThreadPoolElement should have been reaped by
thread_pool_completion_bh() and its callback invoked.  For some reason
this didn't happen and the program is blocked in poll(2) waiting.

This suggests a race condition in thread-pool.c or qemu_bh_schedule()
(used to complete ThreadPoolElement from a QEMU event loop).

I don't have a good theory why this happens yet.  Just wanted to share
in case someone else hits this problem.

Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-04-02 17:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-02 16:26 [Qemu-devel] thread-pool.c race condition? Stefan Hajnoczi
2015-04-02 16:43 ` Paolo Bonzini
2015-04-02 16:44   ` Stefan Hajnoczi
2015-04-02 16:46   ` John Snow
2015-04-02 16:47   ` Stefan Hajnoczi
2015-04-02 17:00     ` Paolo Bonzini

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).