On 29/12/2017 02:31, Fam Zheng wrote:
>> we have the following comment:
>>
>>     /* Writing to the list requires the BQL _and_ the dirty_bitmap_mutex.
>>      * Reading from the list can be done with either the BQL or the
>>      * dirty_bitmap_mutex.  Modifying a bitmap only requires
>>      * dirty_bitmap_mutex. */
>>     QemuMutex dirty_bitmap_mutex;
>>
>> (I don't understand well the logic, why is it so. Paolo introduced the lock,
>> but didn't update some functions..)
>>
>> so, actually, here we need both BQL and mutex.
>
> Yes, because of that comment my interpretion has been both "BQL and the mutex"
> whereever we say "within bdrv_dirty_bitmap_lock..unlock", as to some other
> places in this file.

A bit late, but---no, "within bdrv_dirty_bitmap_lock..unlock" means it's
the "modifying the bitmap" case.

Most functions that looks at the list are "called with BQL taken".
Functions that write to the list are "called with BQL taken" and call
bdrv_dirty_bitmaps_lock/bdrv_dirty_bitmaps_unlock themselves.

Paolo

Reply via email to