[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 for-7.1 7/9] nbd: move s->state under requests_lock
From: |
Eric Blake |
Subject: |
Re: [PATCH v2 for-7.1 7/9] nbd: move s->state under requests_lock |
Date: |
Thu, 14 Apr 2022 14:40:13 -0500 |
User-agent: |
NeoMutt/20211029-34-be16c3 |
On Thu, Apr 14, 2022 at 07:57:54PM +0200, Paolo Bonzini wrote:
> Remove the confusing, and most likely wrong, atomics. The only function
> that used to be somewhat in a hot path was nbd_client_connected(),
> but it is not anymore after the previous patches.
>
> The same logic is used both to check if a request had to be reissued
> and also in nbd_reconnecting_attempt(). The former cases are outside
> requests_lock, while nbd_reconnecting_attempt() does have the lock,
> therefore the two have been separated in the previous commit.
> nbd_client_will_reconnect() can simply take s->requests_lock, while
> nbd_reconnecting_attempt() can inline the access now that no
> complicated atomics are involved.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> block/nbd.c | 78 ++++++++++++++++++++++++++++-------------------------
> 1 file changed, 41 insertions(+), 37 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- Re: [PATCH v2 for-7.1 3/9] nbd: remove peppering of nbd_client_connected, (continued)
- [PATCH v2 for-7.1 4/9] nbd: keep send_mutex/free_sema handling outside nbd_co_do_establish_connection, Paolo Bonzini, 2022/04/14
- [PATCH v2 for-7.1 5/9] nbd: use a QemuMutex to synchronize yanking, reconnection and coroutines, Paolo Bonzini, 2022/04/14
- [PATCH v2 for-7.1 7/9] nbd: move s->state under requests_lock, Paolo Bonzini, 2022/04/14
- [PATCH v2 for-7.1 6/9] nbd: code motion and function renaming, Paolo Bonzini, 2022/04/14
- [PATCH v2 for-7.1 9/9] nbd: document what is protected by the CoMutexes, Paolo Bonzini, 2022/04/14
- [PATCH v2 for-7.1 8/9] nbd: take receive_mutex when reading requests[].receiving, Paolo Bonzini, 2022/04/14