Re: [PATCH v1 1/9] ext2: fix ext2_xattr_delete_inode() context analysis warning
From: Timothy Day
Date: Tue Jul 14 2026 - 00:17:57 EST
On Mon, 13 Jul 2026 22:26:02 -0400, Theodore Tso wrote:
> On Mon, Jul 13, 2026 at 12:44:17PM -0500, Timothy Day wrote:
> > I don't think we'd want to disable unlikely() globally when context
> > analysis is enabled. Only for cases where it'd conflict with the
> > context analysis annotation. Long term, I think we'd want context
> > analysis enabled by default for Clang builds.
>
> I see that Marco has a potential change to make LLVM/Clang to handle
> this better, which is great, but I'm not sure why disabling unlikely()
> globally when context analysis is enabled would be that terrible.
> Context analysis wouldn't be changed with or without unlikely(), and
> if we use context analysis as a debugging build pass, we wouldn't care
> about performance, right? What am I missing?
It's mostly convenience, I think. If the context analysis could be
made to work without any runtime penalty, then you don't need a
separate debug build. If you're doing a bunch of kernel builds
anyway, that's not very compelling. But if it were automatically
enabled whenever Clang is being used, developers might catch these
issues faster. They might not think to enable these warnings
otherwise. And if distros ever used Clang for kernel builds more
widely, they could enable this feature by default. Then
out-of-tree modules could benefit from the feature without having
to make a custom kernel.
Tim Day