Re: Re: [PATCH 1/2] ext4: avoid RWM atomic in EXT4_MB_GRP_TEST_AND_SET_READ
From: Bohdan Trach
Date: Tue May 26 2026 - 06:10:47 EST
On Mon, 25 May 2026 17:28:45, Jan Kara wrote:
> Good idea but do we really need the 'acquire' barrier here? I don't see
> anything that would really need this so I think
> EXT4_MB_GRP_TEST_AND_SET_READ() can be just:
>
> test_bit(EXT4_GROUP_INFO_BBITMAP_READ_BIT, &grp->bb_state) || \
> test_and_set_bit(EXT4_GROUP_INFO_BBITMAP_READ_BIT, &grp->bb_state)
>
> or am I missing something?
Thanks for the review. Indeed, it should not be mandatory to use
test_bit_acquire(), I've used it to keep the original ordering
semantics of test_and_set_bit(), as I understood it from [1],
and thus of the whole macro.
I'll use plain test_bit() in the v2 series (+taking into account your
comment for the patch 2/2, and retest).
[1] https://docs.kernel.org/core-api/wrappers/atomic_bitops.html
--
With best regards,
Bohdan Trach