From: Paolo Bonzini <pbonzini@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu block <qemu-block@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>,
Max Reitz <mreitz@redhat.com>
Subject: Re: What is bs->reqs_lock for?
Date: Tue, 18 Aug 2020 08:16:09 +0200 [thread overview]
Message-ID: <8d337bc3-e3a7-d941-aa70-642f9ce0fcbe@redhat.com> (raw)
In-Reply-To: <e6d75774-300d-c38d-3f07-0cbc39aff54e@virtuozzo.com>
On 13/08/20 18:34, Vladimir Sementsov-Ogievskiy wrote:
> I thought bs is attached to one aio context and aio context attached to
> one iothread.
For now yes, but with multiqueue there would be many iothreads sending
requests to the AioContext. The BDS would still have a "home"
aiocontext to request socket readiness events, but
io_uring/linux_aio/threadpool requests could be issued from any iothread.
> And all normal request processing of the bs is done in this one iothread.
> And when we need to access bs externally, we do it in
> aio_context_acquire / aio_context_release, which protects from parallel
> access to BlockDriverState fields...
>
> But you say, that block/io.c is not protected by AioContext lock..
> Does it mean that everything must be thread-safe in block/io.c and all
> block drivers?
Yes.
>
> Are tracked_requests different from other fields? A lot of other
> BlockDriverState
> fields are not protected by any mutex.. For example: total_sectors,
> file, backing..
Rules are documented in include/block/block_int.h. It seems however
that never_freeze was blindly added at the end.
Paolo
> Could you give an example of parallel access to tracked_requests?
>
next prev parent reply other threads:[~2020-08-18 6:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-13 14:57 What is bs->reqs_lock for? Vladimir Sementsov-Ogievskiy
2020-08-13 15:54 ` Paolo Bonzini
2020-08-13 16:34 ` Vladimir Sementsov-Ogievskiy
2020-08-18 6:16 ` Paolo Bonzini [this message]
2020-08-19 9:41 ` Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d337bc3-e3a7-d941-aa70-642f9ce0fcbe@redhat.com \
--to=pbonzini@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).