Re: [Qemu-devel] qemu AIO worker threads change causes Guest OS hangup

2016-03-07 Thread Huaicheng Li (coperd)
> On Mar 5, 2016, at 8:42 PM, Huaicheng Li (coperd) wrote: > > >> On Mar 1, 2016, at 3:01 PM, Paolo Bonzini > > wrote: >> >> This is done >> because the worker threads only care about the queued request list, not >> about active or completed requests. > > Do you th

Re: [Qemu-devel] qemu AIO worker threads change causes Guest OS hangup

2016-03-07 Thread Paolo Bonzini
On 06/03/2016 03:42, Huaicheng Li (coperd) wrote: > >> On Mar 1, 2016, at 3:01 PM, Paolo Bonzini > > wrote: >> >> This is done >> because the worker threads only care about the queued request list, not >> about active or completed requests. > > Do you think it would

Re: [Qemu-devel] qemu AIO worker threads change causes Guest OS hangup

2016-03-05 Thread Huaicheng Li (coperd)
> On Mar 1, 2016, at 3:01 PM, Paolo Bonzini wrote: > > This is done > because the worker threads only care about the queued request list, not > about active or completed requests. Do you think it would be useful to add an API for inserting one request back to the queued list? For example, In c

Re: [Qemu-devel] qemu AIO worker threads change causes Guest OS hangup

2016-03-05 Thread Huaicheng Li (coperd)
> On Mar 1, 2016, at 3:34 PM, Stefan Hajnoczi wrote: > > Have you seen Linux Documentation/device-mapper/delay.txt? > > You could set up a loopback block device and put the device-mapper delay > target on top to simulate latency. I’m working on one idea to emulate the latency of SSD read/wri

Re: [Qemu-devel] qemu AIO worker threads change causes Guest OS hangup

2016-03-01 Thread Stefan Hajnoczi
- Original Message - > From: "Huaicheng Li" > I’m trying to add some latency conditionally to I/O requests (qemu_paiocb, > from **IDE** disk emulation, **raw** image file). Paolo already covered the technical issue with what you're doing. Have you seen Linux Documentation/device-mapper/d

Re: [Qemu-devel] qemu AIO worker threads change causes Guest OS hangup

2016-03-01 Thread Paolo Bonzini
On 01/03/2016 19:45, Huaicheng Li wrote: > > * 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. No, it's not possible. The "all" list in thread-pool.c is protected with the AioContext lock, not with t

[Qemu-devel] qemu AIO worker threads change causes Guest OS hangup

2016-03-01 Thread Huaicheng Li
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/