[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] block/blklogwrites: Protect mutable driver state with a m
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v3] block/blklogwrites: Protect mutable driver state with a mutex. |
Date: |
Fri, 19 Jan 2024 18:47:34 +0100 |
Am 19.01.2024 um 17:29 hat Ari Sundholm geschrieben:
> During the review of a fix for a concurrency issue in blklogwrites,
> it was found that the driver needs an additional fix when enabling
> multiqueue, which is a new feature introduced in QEMU 9.0, as the
> driver state may be read and written by multiple threads at the same
> time, which was not the case when the driver was originally written.
>
> Fix the multi-threaded scenario by introducing a mutex to protect the
> mutable fields in the driver state, and always having the mutex locked
> by the current thread when accessing them. Also use the mutex and a
> CoQueue to ensure that the super block is not being written to by
> multiple threads concurrently and updates are properly serialized.
>
> Additionally, add the const qualifier to a few BDRVBlkLogWritesState
> pointer targets in contexts where the driver state is not written to.
>
> Signed-off-by: Ari Sundholm <ari@tuxera.com>
>
> v1->v2: Ensure that the super block is not written to concurrently.
> v2->v3: Use a CoQueue instead of a condition variable, as the latter
> does not make the currently executing coroutine yield on entering a
> wait.
> ---
> block/blklogwrites.c | 85 +++++++++++++++++++++++++++++++++++++++-----
> 1 file changed, 77 insertions(+), 8 deletions(-)
For your next series, please put the changelog between versions below
the "---" marker so that git am doesn't consider it part of the commit
message.
Thanks, applied to the block branch.
Kevin
- Re: [PATCH] block/blklogwrites: Fix a bug when logging "write zeroes" operations., (continued)
- [PATCH v2] block/blklogwrites: Protect mutable driver state with a mutex., Ari Sundholm, 2024/01/11
- Re: [PATCH v2] block/blklogwrites: Protect mutable driver state with a mutex., Kevin Wolf, 2024/01/18
- Re: [PATCH v2] block/blklogwrites: Protect mutable driver state with a mutex., Ari Sundholm, 2024/01/19
- Re: [PATCH v2] block/blklogwrites: Protect mutable driver state with a mutex., Kevin Wolf, 2024/01/19
- [PATCH v3] block/blklogwrites: Protect mutable driver state with a mutex., Ari Sundholm, 2024/01/19
- Re: [PATCH v3] block/blklogwrites: Protect mutable driver state with a mutex.,
Kevin Wolf <=