All of lore.kernel.org
 help / color / mirror / Atom feed
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

  reply	other threads:[~2026-08-04 12:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04 10:08 [PATCH] mm: add some missing includes to mm-local headers Lorenzo Stoakes (ARM)
2026-08-04 10:44 ` Vlastimil Babka (SUSE)
2026-08-04 10:45 ` David Hildenbrand (Arm)
2026-08-04 10:51   ` David Hildenbrand (Arm)
2026-08-04 11:05     ` Lorenzo Stoakes (ARM)
2026-08-04 11:11       ` David Hildenbrand (Arm)
2026-08-04 11:02   ` Lorenzo Stoakes (ARM)
2026-08-04 12:17     ` David Hildenbrand (Arm) [this message]
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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.