Re: [PATCH] mm: add some missing includes to mm-local headers

"David Hildenbrand (Arm)" <[email protected]> Tue, 4 Aug 2026 13:11:04 +0200
Newsgroups org.kernel.vger.cgroups,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <[email protected]>
On 8/4/26 13:05, Lorenzo Stoakes (ARM) wrote:
> On Tue, Aug 04, 2026 at 12:51:40PM +0200, David Hildenbrand (Arm) wrote:
>> On 8/4/26 12:45, David Hildenbrand (Arm) wrote:
>>>
>>> I'm curious, how did you identify these? The mm/vmalloc.h is rather easy, but I wonder about
>>> e.g., mm/shuffle.h including mmzone.h.
>>>
>>
>> To clarify, I have clangd running behind a vim plugin, and so far it just worked.
>>
>> I had to generate a weird XML at some point that does magical things for clangd.
> 
> Well for me I get the kernel build to generate compiler_commands.json and use
> that via:
> 
> 	scripts/clang-tools/gen_compile_commands.py vmlinux.a arch/x86/boot/
> 
> In a build script.
> 
> But maybe I need your weird XML... I do get frustrated that it limits things to
> what I happened to compile. It'd be nice to get it to index literally everything
> somehow.

Nah, it was that magical json I had in mind.

> 
>>
>> So I'm curious how to invoke clangd manually to actually get these reports.
> 
> See other reply, it's just that I noticed missing symbols.
> 
> Actually this happened with vma.h (I sloppily got AI to figure out any other
> cases) which _intentionally_ doesn't have includes.
> 
> But clangd lets you work around that in .clangd:
> 
> If:
>   PathMatch: mm/vma\.h
> CompileFlags:
>   Add: [-include, mm/vma_internal.h]
> 
> :)
I was hoping for an easy-to-run script that complains, instead of people just randomly
running into "missing symbols" and then having to fix it.

But there doesn't seem to be a low hanging fruit.

-- 
Cheers,

David