Re: [PATCH v2] t10-pi: reduce ref tag code duplication
From: Keith Busch
Date: Fri Apr 17 2026 - 12:55:53 EST
On Fri, Apr 17, 2026 at 08:34:30AM -0700, Caleb Sander Mateos wrote:
> On Fri, Apr 17, 2026 at 12:56 AM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
> > folks out there actually dropping not needed includes from headers as
> > it can significantly reduce compile time. Now this is not a heavily
> > included header so it's unlikely to make a difference anyway.
>
> Is a file being included by the preprocessor multiple times really
> that expensive? I would have assumed it would be cached the first time
> it was included.
Do modern compilers even incur a cost? They all have "multiple-include
optimization" features as far as i know. Not that we use "#prama once"
in kernel, but compilers look like they're smart enough to recognize the
#ifdef guards for the same purpose.
https://gcc.gnu.org/onlinedocs/cppinternals/Guard-Macros.html#The-Multiple-Include-Optimization