qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 11/15] jobs: remove aiocontext locks since the functions


From: Emanuele Giuseppe Esposito
Subject: Re: [RFC PATCH 11/15] jobs: remove aiocontext locks since the functions are under BQL
Date: Wed, 3 Nov 2021 16:56:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1



On 02/11/2021 13:41, Vladimir Sementsov-Ogievskiy wrote:
Hmm. subject looks like it's safe to remove aiocontext locks from any qmp command?

For example, commit 91005a495e228eb added aiocontext locks back to qmp bitmap add/remove commands because otherwise they crashed.

So, I'm not sure that being under BQL is enough to drop aiocontext locking..



In this specific case the aiocontext is useless there. I am not sure what it was used for before, but if you look at what it protects in this patch we have:

- block_job_query: not called by anyone else, and internally calls:
* block_job_is_internal = checks struct job id, that is only written at job initialization
        * progress_get_snapshot = we made it thread safe, as you might remember
* accesses struct job fields, that we protect anyways with job_mutex. Anyways the aiocontext is not used to protect jobs fields.

- job_query_single: same as block_job_query, calls progress_get_snapshot and accesses job fields.

So yes, I am positive that here removing the aiocontext lock does not break anything.

Thank you,
Emanuele




reply via email to

[Prev in Thread] Current Thread [Next in Thread]