[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 24/29] bitmap: add atomic test and clear
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 24/29] bitmap: add atomic test and clear |
Date: |
Tue, 26 May 2015 14:33:49 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
On 26/05/2015 14:27, Fam Zheng wrote:
> It's broken if the clear range is the last part of first word:
>
> map = 0xFFFFFFFFFFFFFFFF, ...
>
> bitmap_test_and_clear_atomic(map, 60, 4):
>
> Expected result:
>
> 0xFFFFFFFFFFFFFFFF, ...
>
> Actual result:
>
> 0x0
You're right, this:
/* Full words */
while (nr - bits_to_clear >= 0) {
must be surrounded by an "if (mask_to_clear == ~0UL)" or "if
(bits_to_clear == BITS_PER_LONG)." Patch 23 has the same problem.
Paolo