Re: [PATCH 1/2] mm/shrinker: size shrinker_info_unit to a power of two

From: Konstantin Khorenko

Date: Wed Oct 14 2026 - 10:03:20 EST


On 10/13/26 08:18, Muchun Song wrote:
>
>
>> On Oct 13, 2026, at 03:02, Konstantin Khorenko <khorenko@xxxxxxxxxxxxx> wrote:
>>
<skipped>

>> /*
>> * Bitmap and deferred work of shrinker::id corresponding to memcg-aware
>> @@ -18,6 +22,9 @@ struct shrinker_info_unit {
>> DECLARE_BITMAP(map, SHRINKER_UNIT_BITS);
>> };
>>
>> +static_assert(!(sizeof(struct shrinker_info_unit) &
>> + (sizeof(struct shrinker_info_unit) - 1)));
>
> This assertion is not straightforward. I'd like to use is_power_of_two().
> Like:
>
> BUILD_BUG_ON(!is_power_of_2(sizeof(struct shrinker_info_unit)));

No problem, i'll send a v2 with the modified assertion.
Muchun, thank you for the review!

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team