[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/6] progressmeter: protect with a mutex
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH 4/6] progressmeter: protect with a mutex |
Date: |
Wed, 12 May 2021 16:53:04 +0100 |
On Mon, May 10, 2021 at 10:59:39AM +0200, Emanuele Giuseppe Esposito wrote:
> Progressmeter is protected by the AioContext mutex, which
> is taken by the block jobs and their caller (like blockdev).
>
> We would like to remove the dependency of block layer code on the
> AioContext mutex, since most drivers and the core I/O code are already
> not relying on it.
>
> The simplest thing to do is to add a mutex to be able to provide
> an accurate snapshot of the progress values to the caller.
>
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> ---
> blockjob.c | 33 +++++++++++++++++++++++++--------
> include/qemu/progress_meter.h | 31 +++++++++++++++++++++++++++++++
> job-qmp.c | 8 ++++++--
> job.c | 3 +++
> qemu-img.c | 9 ++++++---
> 5 files changed, 71 insertions(+), 13 deletions(-)
Unlike the next two patches where I had comments, here adding the lock
makes sense to me - the point of the progress meter is to report numbers
to the monitor thread so thread-safety is a key part of the API's value.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
signature.asc
Description: PGP signature
- Re: [PATCH 1/6] ratelimit: treat zero speed as unlimited, (continued)
Re: [PATCH 4/6] progressmeter: protect with a mutex,
Stefan Hajnoczi <=
[PATCH 6/6] aiopool: protect with a mutex, Emanuele Giuseppe Esposito, 2021/05/10
[PATCH 2/6] block-copy: let ratelimit handle a speed of 0, Emanuele Giuseppe Esposito, 2021/05/10
[PATCH 5/6] co-shared-resource: protect with a mutex, Emanuele Giuseppe Esposito, 2021/05/10