From: "David Hildenbrand (Arm)" <david@kernel.org>
To: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Muchun Song <muchun.song@linux.dev>,
Oscar Salvador <osalvador@suse.de>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>,
"Liam R. Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Brendan Jackman <brendan.jackman@linux.dev>,
Zi Yan <ziy@nvidia.com>, Chris Li <chrisl@kernel.org>,
Kairui Song <kasong@tencent.com>,
Kemeng Shi <shikemeng@huaweicloud.com>,
Nhat Pham <nphamcs@gmail.com>, Baoquan He <baoquan.he@linux.dev>,
Barry Song <baohua@kernel.org>,
Youngjun Park <youngjun.park@lge.com>,
Uladzislau Rezki <urezki@gmail.com>,
Michal Hocko <mhocko@suse.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
cgroups@vger.kernel.org
Subject: Re: [PATCH] mm: add some missing includes to mm-local headers
Date: Tue, 4 Aug 2026 14:17:11 +0200 [thread overview]
Message-ID: <22a540a9-9a48-4c77-a392-4d72a7a6b68b@kernel.org> (raw)
In-Reply-To: <anHDNwlcBlIfC-Hv@lucifer>
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) <david@kernel.org>
--
Cheers,
David
next prev parent reply other threads:[~2026-08-04 14:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260804-fix-some-local-headers-v1-1-a7beb173c116@kernel.org>
[not found] ` <8179be78-a35c-4d0f-8034-27f3154db0e7@kernel.org>
2026-08-04 11:02 ` [PATCH] mm: add some missing includes to mm-local headers Lorenzo Stoakes (ARM)
2026-08-04 12:17 ` David Hildenbrand (Arm) [this message]
[not found] ` <7e7c8e04-646f-4135-9ba5-e0c7fd6d8b41@kernel.org>
2026-08-04 11:05 ` Lorenzo Stoakes (ARM)
2026-08-04 11:11 ` David Hildenbrand (Arm)
2026-08-04 20:00 ` Zi Yan
2026-08-04 22:21 ` Barry Song
2026-08-05 2:45 ` Baoquan He
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22a540a9-9a48-4c77-a392-4d72a7a6b68b@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baoquan.he@linux.dev \
--cc=brendan.jackman@linux.dev \
--cc=cgroups@vger.kernel.org \
--cc=chrisl@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=kasong@tencent.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--cc=muchun.song@linux.dev \
--cc=nphamcs@gmail.com \
--cc=osalvador@suse.de \
--cc=roman.gushchin@linux.dev \
--cc=rppt@kernel.org \
--cc=shakeel.butt@linux.dev \
--cc=shikemeng@huaweicloud.com \
--cc=surenb@google.com \
--cc=urezki@gmail.com \
--cc=vbabka@kernel.org \
--cc=youngjun.park@lge.com \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox