qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/8] blockdev: avoid acquiring AioContext lock twice at do_drive_backup and do_blockdev_backup
@ 2019-11-12 11:30 Sergio Lopez
  2019-11-12 11:30 ` [PATCH v3 1/8] blockdev: merge drive_backup_prepare with do_drive_backup Sergio Lopez
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Sergio Lopez @ 2019-11-12 11:30 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Sergio Lopez, Markus Armbruster, qemu-block, Max Reitz

do_drive_backup() acquires the AioContext lock of the corresponding
BlockDriverState. This is not a problem when it's called from
qmp_drive_backup(), but drive_backup_prepare() also acquires the lock
before calling it. The same things happens with do_blockdev_backup()
and blockdev_backup_prepare().

This patch series merges do_drive_backup() with drive_backup_prepare()
and do_blockdev_backup() with blockdev_backup_prepare(), and ensures
they're only getting called from a transaction context. This way,
there's a single code path for both transaction requests and qmp
commands, as suggested by Kevin Wolf.

We also take this opportunity to ensure we're honoring the context
acquisition semantics required by bdrv_try_set_aio_context, as
suggested by Max Reitz.

---
Changelog:

v3:
 - Rework the whole patch series to fix the issue by consolidating all
   operations in the transaction model. (thanks Kevin Wolf)

v2:
 - Honor bdrv_try_set_aio_context() context acquisition requirements
   (thanks Max Reitz).
 - Release the context at drive_backup_prepare() instead of avoiding
   re-acquiring it at do_drive_baclup(). (thanks Max Reitz)
 - Convert a single patch into a two-patch series.
---

Sergio Lopez (8):
  blockdev: merge drive_backup_prepare with do_drive_backup
  blockdev: fix coding style issues in drive_backup_prepare
  blockdev: place drive_backup_prepare with the other related
    transaction functions
  blockdev: change qmp_drive_backup to make use of transactions
  blockdev: merge blockdev_backup_prepare with do_blockdev_backup
  blockdev: place blockdev_backup_prepare with the other related
    transaction helpers
  blockdev: change qmp_blockdev_backup to make use of transactions
  blockdev: honor bdrv_try_set_aio_context() context requirements

 blockdev.c | 349 ++++++++++++++++++++++++++---------------------------
 1 file changed, 171 insertions(+), 178 deletions(-)

-- 
2.23.0



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2019-11-19 12:34 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12 11:30 [PATCH v3 0/8] blockdev: avoid acquiring AioContext lock twice at do_drive_backup and do_blockdev_backup Sergio Lopez
2019-11-12 11:30 ` [PATCH v3 1/8] blockdev: merge drive_backup_prepare with do_drive_backup Sergio Lopez
2019-11-19  9:14   ` Max Reitz
2019-11-12 11:30 ` [PATCH v3 2/8] blockdev: fix coding style issues in drive_backup_prepare Sergio Lopez
2019-11-12 11:30 ` [PATCH v3 3/8] blockdev: place drive_backup_prepare with the other related transaction functions Sergio Lopez
2019-11-12 11:30 ` [PATCH v3 4/8] blockdev: change qmp_drive_backup to make use of transactions Sergio Lopez
2019-11-12 11:30 ` [PATCH v3 5/8] blockdev: merge blockdev_backup_prepare with do_blockdev_backup Sergio Lopez
2019-11-12 11:30 ` [PATCH v3 6/8] blockdev: place blockdev_backup_prepare with the other related transaction helpers Sergio Lopez
2019-11-12 11:30 ` [PATCH v3 7/8] blockdev: change qmp_blockdev_backup to make use of transactions Sergio Lopez
2019-11-12 11:30 ` [PATCH v3 8/8] blockdev: honor bdrv_try_set_aio_context() context requirements Sergio Lopez
2019-11-12 22:49 ` [PATCH v3 0/8] blockdev: avoid acquiring AioContext lock twice at do_drive_backup and do_blockdev_backup no-reply
2019-11-13  9:14   ` Sergio Lopez
2019-11-13 13:24     ` Sergio Lopez
2019-11-19  9:36       ` Max Reitz
2019-11-19 10:54         ` Sergio Lopez
2019-11-19 11:18           ` Kevin Wolf
2019-11-19 11:35             ` Sergio Lopez
2019-11-19 12:13               ` Kevin Wolf
2019-11-19 12:31                 ` Sergio Lopez

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).