[Top][All Lists]

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

Re: [Qemu-block] [Qemu-devel] [PATCH v9 03/13] block/dirty-bitmap: add _

From: Paolo Bonzini
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v9 03/13] block/dirty-bitmap: add _locked version of bdrv_reclaim_dirty_bitmap
Date: Thu, 18 Jan 2018 09:43:00 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

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.


reply via email to

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