[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250507214616.4d91620e@pumpkin>
Date: Wed, 7 May 2025 21:46:16 +0100
From: David Laight <david.laight.linux@...il.com>
To: WangYuli <wangyuli@...ontech.com>
Cc: Matthew Wilcox <willy@...radead.org>, akpm@...ux-foundation.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org, yuzhao@...gle.com,
stevensd@...omium.org, kaleshsingh@...gle.com, zhanjun@...ontech.com,
niecheng1@...ontech.com, guanwentao@...ontech.com
Subject: Re: [PATCH] mm: vmscan: Avoid signedness error for GCC 5.4
On Wed, 7 May 2025 10:55:31 +0800
WangYuli <wangyuli@...ontech.com> wrote:
> Hi Matthew Wilcox and Andrew Morton,
>
> On 2025/5/7 00:22, Matthew Wilcox wrote:
> > 1. This has nothing to do with the compiler version; the type-checking
> > is built into min().
>
> Thank you for pointing that out! My previous statement was incorrect.
>
> The error is actually from the __types_ok check within the
> __careful_cmp_once macro failing, which triggered BUILD_BUG_ON.
>
> But then, why do newer compilers compile this without error? Is it
> perhaps because they consider 4U - 1 to be signed?
No, statically_true(tier >= 0) is true even though 'tier' is signed
because the compiler has inlined the function and followed the domain
of 'tier' from the assignments and loops.
David
Powered by blists - more mailing lists