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

"David Hildenbrand (Arm)" <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.kernel.mm,gmane.linux.kernel.cgroups
Message-ID <[email protected]>
On 8/4/26 13:02, Lorenzo Stoakes (ARM) wrote:
> On Tue, Aug 04, 2026 at 12:45:22PM +0200, David Hildenbrand (Arm) wrote:
>> On 8/4/26 12:08, Lorenzo Stoakes (ARM) wrote:
>>> There are a number of internal headers local to mm/ which reference
>>> functions and data types without including the relevant headers.
>>>
>>> mm/vma.h is a special case that intentionally does not include additional
>>> headers, but the others are not.
>>>
>>> This breaks tooling like clangd (which is where I noticed this), though the
>>> build is OK due to the C files including the headers happening to include
>>> required dependencies.
>>>
>>> It's better to be explicit about dependencies anyway, so add the missing
>>> includes and fix clangd as a bonus.
>>
>> 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.
> 
> Well I got AI to look them up ;) but I pared down what it gave me to a simpler
> subset and checked everything so I don't consider myself in a state of
> slopper-sin :)
> 
> [this kind of check ideas, look things up stuff I don't consider warrants an
> Assisted-by tag btw].
> 
> The headers for everything but shuffle.h are obvious, so that's the tricky one -
> it's for pg_data_t and struct zone specifically.
> 
> How I discovered this with clangd initially was - Do something like 'C-c l g r' or
> 'C-c l g g' in emacs via LSP and it reports 'no symbols' for something I _know_ is
> compiled in.

emacs ...  there's your problem :P

Thanks for the explanation, I'm afraid this might become a whack-a-mole without
a proper way to detect this automatically. But that does not really seem doable
easily.

Acked-by: David Hildenbrand (Arm) <[email protected]>

-- 
Cheers,

David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.