Re: [PATCH v2] Fix the data type inconsistency issue of min (tier, MAX_CR_TIERS-1) in read_ctrl_pos

From: David Hildenbrand
Date: Fri Aug 08 2025 - 05:59:11 EST


On 08.08.25 11:54, Qingshuang Fu wrote:
From: Qingshuang Fu <fuqingshuang@xxxxxxxxxx>

Due to the fact that the tier data type in min (tier, MAX_CR_TIERS -1)
is int,but MAX_CR_TIERS is an unsigned type, directly using
the min function for comparison will result in an error:

from mm/vmscan.c:15:
mm/vmscan.c: In function ‘read_ctrl_pos’:
./include/linux/build_bug.h:78:41: error: static assertion failed:
"min(tier, 4U - 1) signedness error, fix types or
consider umin() before min_t()"

Fixes: 37a260870f2c ("mm/mglru: rework type selection")
Suggested-by: David Hildenbrand <david@xxxxxxxxxx>

You keep ignoring my feedback and I can only reproduce this with W=2 where there are like a bunch of other issues, this here doesn't move the needle.

So I'm afraid I cannot spend any more time on reviewing this patch.

NAK

--
Cheers,

David / dhildenb