Re: [PATCH] mm: optimize the implementation of WARN_ON_ONCE_GFP()
From: Matthew Wilcox
Date: Mon Mar 09 2026 - 11:44:55 EST
On Mon, Mar 09, 2026 at 11:38:11PM +0800, Xie Yuanbin wrote:
> As shown in the commit message of commit 242b872239f6a7deacbc
> ("include/linux/once_lite.h: fix judgment in WARN_ONCE with clang"),
> the code "unlikely(a && b)" may generate poor assembly code if it is
> actually "unlikely(a) && unlikely(b)" or "unlikely(a) && b".
Why fix this in multiple places in the kernel instead of once in clang?