[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.9] blockjob: avoid recursive AioContext lo
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH for-2.9] blockjob: avoid recursive AioContext locking |
Date: |
Tue, 21 Mar 2017 14:15:43 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 03/21/2017 12:48 PM, Paolo Bonzini wrote:
> Streaming or any other block job hangs when performed on a block device
> that has a non-default iothread. This happens because the AioContext
> is acquired twice by block_job_defer_to_main_loop_bh and then released
> only once by BDRV_POLL_WHILE. (Insert rants on recursive mutexes, which
>
> unfortunately are a temporary but necessary evil for iothreads at the
Why the blank line?
> moment).
>
> Luckily, the reason for the double acquisition is simple; the function
> acquires the AioContext for both the job iothread and the BDS iothread,
> in case the BDS iothread was changed while the job was running. It
> is therefore enough to skip the second acquisition when the two
> AioContexts are one and the same.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> blockjob.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
Makes sense from the description.
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature