qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sergio Lopez <slp@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	Sergio Lopez <slp@redhat.com>,
	qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>,
	Nir Soffer <nsoffer@redhat.com>
Subject: [PATCH v2 0/2] nbd/server: Quiesce server on drained section
Date: Wed,  2 Jun 2021 08:05:50 +0200	[thread overview]
Message-ID: <20210602060552.17433-1-slp@redhat.com> (raw)

Before switching between AioContexts we need to make sure that we're
fully quiesced ("nb_requests == 0" for every client) when entering the
drained section. Otherwise, coroutines may be run in the wrong context
after the switch, leading to a number of critical issues.

To accomplish this, we add ".drained_poll" to BlockDevOps and use it
in the NBD server, along with ".drained_being" and "drained_end", to
coordinate the quiescing of the server while entering a drained
section.

v2:
 - Use a bool for the value returned by .drained_poll [Kevin]
 - Change .drained_poll comment to reflect that the returned boolean
   value will be true if the device is still busy, or false otherwise
 - Drop yield_co_list and use recv_coroutine and read_yielding [Kevin]
 - Return "true" or "false" in nbd_drained_poll [Kevin]
 - Fix grammar in the commit message of patch 2 [Eric]

Sergio Lopez (2):
  block-backend: add drained_poll
  nbd/server: Use drained block ops to quiesce the server

 block/block-backend.c          |  7 ++-
 include/sysemu/block-backend.h |  4 ++
 nbd/server.c                   | 82 +++++++++++++++++++++++++---------
 3 files changed, 71 insertions(+), 22 deletions(-)

-- 
2.26.2




             reply	other threads:[~2021-06-02  6:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02  6:05 Sergio Lopez [this message]
2021-06-02  6:05 ` [PATCH v2 1/2] block-backend: add drained_poll Sergio Lopez
2021-06-02  8:34   ` Vladimir Sementsov-Ogievskiy
2021-06-02  6:05 ` [PATCH v2 2/2] nbd/server: Use drained block ops to quiesce the server Sergio Lopez
2021-06-02 12:06   ` Vladimir Sementsov-Ogievskiy
2021-06-02 12:44     ` Sergio Lopez
2021-06-02 12:48       ` Vladimir Sementsov-Ogievskiy
2021-06-02 11:57 ` [PATCH v2 0/2] nbd/server: Quiesce server on drained section Kevin Wolf

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=20210602060552.17433-1-slp@redhat.com \
    --to=slp@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=nsoffer@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --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).