qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qemu AIO worker threads change causes Guest OS hangup
@ 2016-03-01 18:45 Huaicheng Li
  2016-03-01 21:01 ` Paolo Bonzini
  2016-03-01 21:34 ` Stefan Hajnoczi
  0 siblings, 2 replies; 7+ messages in thread
From: Huaicheng Li @ 2016-03-01 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

Hi all,

I’m trying to add some latency conditionally to I/O requests (qemu_paiocb, from **IDE** disk emulation, **raw** image file). 
My idea is to add this part into the work thread:

  * First, set a timer for each incoming qemu_paiocb structure (e.g. 2ms)
  * When worker thread handles this I/O, it will first check if the timer has expired.
     If so, it will go to normal r/w handling to image files in host. Otherwise, it will insert
     this I/O request back to `request_list` via `qemu_paio_submit`. Here, I just want to skip
     the IO until the timer condition is satisfied.

Logically, I think this should be right. 

But after I run some I/O tests inside Guest OS, the guest OS will hangup (freeze) with “INFO: task xxx blocked for more than 120 seconds”. 
From the guest OS’s perspective, the disk seems to be very busy. Thus, the kernel keeps waiting for IO and have no responsiveness to other tasks. So I guess it should still be the problem of worker threads.


My questions are:

  * Is it safe to call `qemu_paio_submit` from one worker thread? Since all request_access accesses are protected by lock, I think this is OK.

  * What are the possible reasons why guest OS hangs up? My understand is that, although worker threads will busy with skipping I/O for many times, they will eventually finish the task (guest OS freezes after my r/w test program runs successfully, then guest OS becomes unresponsive).

  * Any thoughts on debugging? Currently I’m do some checking (e.g. the request_list length, number of threads) via printf. For this part, it seems hard to use gdb for debugging because guest OS will trigger timeout if I stay at some breakpoints for “too long”. 

Any suggestions would be appreciated. 

Thanks.

Best,
Huaicheng

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

end of thread, other threads:[~2016-03-07 14:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 18:45 [Qemu-devel] qemu AIO worker threads change causes Guest OS hangup Huaicheng Li
2016-03-01 21:01 ` Paolo Bonzini
2016-03-06  2:42   ` Huaicheng Li (coperd)
2016-03-07 13:02     ` Paolo Bonzini
2016-03-07 14:32     ` Huaicheng Li (coperd)
2016-03-01 21:34 ` Stefan Hajnoczi
2016-03-06  2:33   ` Huaicheng Li (coperd)

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