[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block: don't set the same context
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] block: don't set the same context |
Date: |
Fri, 15 Feb 2019 06:29:50 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
On 2/15/19 3:19 AM, Denis Plotnikov wrote:
> Adds a fast path on aio context setting preventing
> unnecessary context setting routine.
> Also, it prevents issues with cyclic walk of child
> bds-es appeared because of registring aio walking
registering
> notifiers:
>
> This can happen because of "new" context attachment to VM disk bds.
> When attaching a new context the corresponding aio context handler is
> called for each of aio_notifiers registered on the VM disk bds context.
> Among those handlers, there is the block_job_attached_aio_context handler
> which sets a new aio context for the block job bds. When doing so,
> the old context is detached from all the block job bds children and one of
> them is the VM disk bds, serving as backing store for the blockjob bds,
> although the VM disk bds is actually the initializer of that process.
> Since the VM disk bds is protected with walking_aio_notifiers flag
> from double processing in recursive calls, the assert fires.
>
> Signed-off-by: Denis Plotnikov <address@hidden>
> ---
> block.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
Naive question - do we have to always call
attach_aio_context/detach_aio_context in pairs? If so, will
short-circuiting a nested attach cause reference count problems when we
come to the matching detach calls?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature