Re: [PATCH] sbitmap: use READ_ONCE to access map->word

From: Jens Axboe
Date: Fri Apr 26 2024 - 09:41:07 EST



On Fri, 26 Apr 2024 18:34:44 +0800, linke li wrote:
> In __sbitmap_queue_get_batch(), map->word is read several times, and
> update atomically using atomic_long_try_cmpxchg(). But the first two read
> of map->word is not protected.
>
> This patch moves the statement val = READ_ONCE(map->word) forward,
> eliminating unprotected accesses to map->word within the function.
> It is aimed at reducing the number of benign races reported by KCSAN in
> order to focus future debugging effort on harmful races.
>
> [...]

Applied, thanks!

[1/1] sbitmap: use READ_ONCE to access map->word
commit: 6ad0d7e0f4b68f87a98ea2b239123b7d865df86b

Best regards,
--
Jens Axboe