All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions
@ 2022-07-25 12:21 Emanuele Giuseppe Esposito
  2022-07-25 12:21 ` [PATCH v2 01/11] block.c: assert bs->aio_context is written under BQL and drains Emanuele Giuseppe Esposito
                   ` (12 more replies)
  0 siblings, 13 replies; 35+ messages in thread
From: Emanuele Giuseppe Esposito @ 2022-07-25 12:21 UTC (permalink / raw)
  To: qemu-block
  Cc: Kevin Wolf, Hanna Reitz, Paolo Bonzini, John Snow,
	Vladimir Sementsov-Ogievskiy, Markus Armbruster, Stefan Hajnoczi,
	qemu-devel, Emanuele Giuseppe Esposito

The aim of this series is to reorganize bdrv_try_set_aio_context
and drop BDS ->set_aio_context and ->can_set_aio_ctx callbacks in
favour of a new one, ->change_aio_ctx.

More informations in patch 3 (which is also RFC, due to the doubts
I have with AioContext locks).

Patch 1 just add assertions in the code, 2 extends the transactions API to be able to add also transactions in the tail
of the list.
Patch 3 is the core of this series, and introduces the new callback.
It is marked as RFC and the reason is explained in the commit message.
Patches 4-5-6 implement ->change_aio_ctx in the various block, blockjob
and block-backend BDSes.
Patch 7 substitutes ->change_aio_ctx with the old callbacks, and
patch 8 takes care of deleting the old callbacks and unused code.

This series is based on "job: replace AioContext lock with job_mutex",
but just because it uses job_set_aio_context() introduced there.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Based-on: <20220706201533.289775-1-eesposit@redhat.com>
---
v2:
* remove transaction patch, and drain transactions
* re-add old AioContext lock/unlock, since it makes sense to have it
* typos in commit message
* various cleanups in block-backend callbacks
* use hash map instead of glist when marking visited nodes
* 2 more additional patches, getting rid of
  bdrv_try_set_aio_context and bdrv_child_try_change_aio_context

Emanuele Giuseppe Esposito (11):
  block.c: assert bs->aio_context is written under BQL and drains
  block: use transactions as a replacement of ->{can_}set_aio_context()
  bdrv_change_aio_context: use hash table instead of list of visited
    nodes
  bdrv_child_try_change_aio_context: add transaction parameter
  blockjob: implement .change_aio_ctx in child_job
  block: implement .change_aio_ctx in child_of_bds
  block-backend: implement .change_aio_ctx in child_root
  block: use the new _change_ API instead of _can_set_ and _set_
  block: remove all unused ->can_set_aio_ctx and ->set_aio_ctx callbacks
  block: rename bdrv_child_try_change_aio_context in
    bdrv_try_change_aio_context
  block: remove bdrv_try_set_aio_context and replace it with
    bdrv_try_change_aio_context

 block.c                            | 360 ++++++++++++++++-------------
 block/block-backend.c              |  74 +++---
 block/export/export.c              |   2 +-
 blockdev.c                         |  22 +-
 blockjob.c                         |  50 ++--
 docs/devel/multiple-iothreads.txt  |   4 +-
 include/block/block-global-state.h |  18 +-
 include/block/block_int-common.h   |   6 +-
 job.c                              |   2 +-
 tests/unit/test-bdrv-drain.c       |   6 +-
 tests/unit/test-block-iothread.c   |  10 +-
 11 files changed, 310 insertions(+), 244 deletions(-)

-- 
2.31.1



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

end of thread, other threads:[~2022-10-24 16:10 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-25 12:21 [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions Emanuele Giuseppe Esposito
2022-07-25 12:21 ` [PATCH v2 01/11] block.c: assert bs->aio_context is written under BQL and drains Emanuele Giuseppe Esposito
2022-10-07 14:42   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 02/11] block: use transactions as a replacement of ->{can_}set_aio_context() Emanuele Giuseppe Esposito
2022-10-07 15:49   ` Kevin Wolf
2022-10-24 14:44     ` Emanuele Giuseppe Esposito
2022-07-25 12:21 ` [PATCH v2 03/11] bdrv_change_aio_context: use hash table instead of list of visited nodes Emanuele Giuseppe Esposito
2022-10-07 15:56   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 04/11] bdrv_child_try_change_aio_context: add transaction parameter Emanuele Giuseppe Esposito
2022-10-07 16:10   ` Kevin Wolf
2022-10-24 14:52     ` Emanuele Giuseppe Esposito
2022-07-25 12:21 ` [PATCH v2 05/11] blockjob: implement .change_aio_ctx in child_job Emanuele Giuseppe Esposito
2022-10-10 10:46   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 06/11] block: implement .change_aio_ctx in child_of_bds Emanuele Giuseppe Esposito
2022-10-10 10:47   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 07/11] block-backend: implement .change_aio_ctx in child_root Emanuele Giuseppe Esposito
2022-10-10 10:50   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 08/11] block: use the new _change_ API instead of _can_set_ and _set_ Emanuele Giuseppe Esposito
2022-10-10 12:56   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 09/11] block: remove all unused ->can_set_aio_ctx and ->set_aio_ctx callbacks Emanuele Giuseppe Esposito
2022-10-10 12:56   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 10/11] block: rename bdrv_child_try_change_aio_context in bdrv_try_change_aio_context Emanuele Giuseppe Esposito
2022-10-10 12:56   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 11/11] block: remove bdrv_try_set_aio_context and replace it with bdrv_try_change_aio_context Emanuele Giuseppe Esposito
2022-10-10 12:56   ` Kevin Wolf
2022-07-26 14:24 ` [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions Vladimir Sementsov-Ogievskiy
2022-07-26 14:27   ` Emanuele Giuseppe Esposito
2022-07-27 16:13 ` Vladimir Sementsov-Ogievskiy
2022-08-05 13:22   ` Emanuele Giuseppe Esposito
2022-08-05 13:36     ` Emanuele Giuseppe Esposito
2022-08-05 14:41       ` Vladimir Sementsov-Ogievskiy
2022-08-05 14:35     ` Vladimir Sementsov-Ogievskiy
2022-08-05 14:57       ` Emanuele Giuseppe Esposito
2022-08-06 15:32         ` Vladimir Sementsov-Ogievskiy
2022-08-10 10:22           ` Paolo Bonzini

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.