All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Paolo Bonzini <pbonzini@redhat.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: Wed, 19 Aug 2020 12:41:28 +0300	[thread overview]
Message-ID: <089f919f-01fc-447d-be84-6e269fc16e54@virtuozzo.com> (raw)
In-Reply-To: <8d337bc3-e3a7-d941-aa70-642f9ce0fcbe@redhat.com>

18.08.2020 09:16, Paolo Bonzini wrote:
> 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. 

I should have guessed on my own..

> It seems however
> that never_freeze was blindly added at the end.
> 

Thanks for your answers!


-- 
Best regards,
Vladimir


      reply	other threads:[~2020-08-19  9:42 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
2020-08-19  9:41       ` Vladimir Sementsov-Ogievskiy [this message]

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=089f919f-01fc-447d-be84-6e269fc16e54@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.