All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-7.1 0/8] nbd: actually make s->state thread-safe
@ 2022-04-12 19:41 Paolo Bonzini
  2022-04-12 19:41 ` [PATCH for-7.1 1/8] nbd: actually implement reply_possible safeguard Paolo Bonzini
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: Paolo Bonzini @ 2022-04-12 19:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: eblake

The main point of this series is patch 6, which removes the dubious and
probably wrong use of atomics in block/nbd.c.  This in turn is enabled
mostly by the cleanups in patches 3-5.  Together, they introduce a
QemuMutex that synchronizes the NBD client coroutines, the reconnect_delay
timer and nbd_cancel_in_flight() as well.

The fixes happen to remove an incorrect use of qemu_co_queue_restart_all
and qemu_co_enter_next on the s->free_sema CoQueue, which was not guarded
by s->send_mutex.

The rest is bugfixes, simplifying the code a bit, and extra documentation.

Paolo Bonzini (8):
  nbd: actually implement reply_possible safeguard
  nbd: mark more coroutine_fns
  nbd: remove peppering of nbd_client_connected
  nbd: keep send_mutex/free_sema handling outside
    nbd_co_do_establish_connection
  nbd: use a QemuMutex to synchronize reconnection with coroutines
  nbd: move s->state under requests_lock
  nbd: take receive_mutex when reading requests[].receiving
  nbd: document what is protected by the CoMutexes

 block/coroutines.h |   4 +-
 block/nbd.c        | 295 +++++++++++++++++++++++----------------------
 2 files changed, 154 insertions(+), 145 deletions(-)

-- 
2.35.1



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

end of thread, other threads:[~2022-04-13 21:24 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 19:41 [PATCH for-7.1 0/8] nbd: actually make s->state thread-safe Paolo Bonzini
2022-04-12 19:41 ` [PATCH for-7.1 1/8] nbd: actually implement reply_possible safeguard Paolo Bonzini
2022-04-12 22:05   ` Eric Blake
2022-04-13  7:30     ` Paolo Bonzini
2022-04-12 19:41 ` [PATCH for-7.1 2/8] nbd: mark more coroutine_fns Paolo Bonzini
2022-04-13 12:25   ` Eric Blake
2022-04-13 20:12     ` Paolo Bonzini
2022-04-12 19:41 ` [PATCH for-7.1 3/8] nbd: remove peppering of nbd_client_connected Paolo Bonzini
2022-04-13 12:48   ` Eric Blake
2022-04-12 19:42 ` [PATCH for-7.1 4/8] nbd: keep send_mutex/free_sema handling outside nbd_co_do_establish_connection Paolo Bonzini
2022-04-13 15:42   ` Eric Blake
2022-04-12 19:42 ` [PATCH for-7.1 5/8] nbd: use a QemuMutex to synchronize reconnection with coroutines Paolo Bonzini
2022-04-13  7:35   ` Paolo Bonzini
2022-04-13 15:55   ` Eric Blake
2022-04-13 20:16     ` Paolo Bonzini
2022-04-12 19:42 ` [PATCH for-7.1 6/8] nbd: move s->state under requests_lock Paolo Bonzini
2022-04-13 16:23   ` Eric Blake
2022-04-13 20:21     ` Paolo Bonzini
2022-04-12 19:42 ` [PATCH for-7.1 7/8] nbd: take receive_mutex when reading requests[].receiving Paolo Bonzini
2022-04-13 21:20   ` Eric Blake
2022-04-12 19:42 ` [PATCH for-7.1 8/8] nbd: document what is protected by the CoMutexes Paolo Bonzini
2022-04-13 21:22   ` Eric Blake

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.