[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 6/8] block: assert that graph read and writes are perf
From: |
Stefan Hajnoczi |
Subject: |
Re: [RFC PATCH v2 6/8] block: assert that graph read and writes are performed correctly |
Date: |
Thu, 28 Apr 2022 15:43:44 +0100 |
On Tue, Apr 26, 2022 at 04:51:12AM -0400, Emanuele Giuseppe Esposito wrote:
> diff --git a/include/block/graph-lock.h b/include/block/graph-lock.h
> index f171ba0527..2211d41286 100644
> --- a/include/block/graph-lock.h
> +++ b/include/block/graph-lock.h
> @@ -52,5 +52,20 @@ void coroutine_fn bdrv_graph_co_rdlock(void);
> */
> void coroutine_fn bdrv_graph_co_rdunlock(void);
>
> +/*
> + * assert_bdrv_graph_readable:
> + * Make sure that the reader is either the main loop,
> + * or there is at least a reader helding the rdlock.
> + * In this way an incoming writer is aware of the read and waits.
> + */
> +void assert_bdrv_graph_readable(void);
The name confuses me. I suggest assert_bdrv_graph_rdlock_held().
> +
> +/*
> + * assert_bdrv_graph_writable:
> + * Make sure that the writer is the main loop and has set @has_writer,
> + * so that incoming readers will pause.
> + */
> +void assert_bdrv_graph_writable(void);
assert_bdrv_graph_wrlock_held().
> +
> #endif /* BLOCK_LOCK_H */
>
> --
> 2.31.1
>
signature.asc
Description: PGP signature
- [RFC PATCH v2 4/8] async: register/unregister aiocontext in graph lock list, (continued)
- [RFC PATCH v2 3/8] block: introduce a lock to protect graph operations, Emanuele Giuseppe Esposito, 2022/04/26
- [RFC PATCH v2 8/8] mirror: protect drains in coroutine with rdlock, Emanuele Giuseppe Esposito, 2022/04/26
- [RFC PATCH v2 6/8] block: assert that graph read and writes are performed correctly, Emanuele Giuseppe Esposito, 2022/04/26
- Re: [RFC PATCH v2 6/8] block: assert that graph read and writes are performed correctly,
Stefan Hajnoczi <=
- [RFC PATCH v2 5/8] block.c: wrlock in bdrv_replace_child_noperm, Emanuele Giuseppe Esposito, 2022/04/26
- Re: [RFC PATCH v2 0/8] Removal of AioContext lock, bs->parents and ->children: new rwlock, Emanuele Giuseppe Esposito, 2022/04/27
Re: [RFC PATCH v2 0/8] Removal of AioContext lock, bs->parents and ->children: new rwlock, Stefan Hajnoczi, 2022/04/28