From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: mingo@kernel.org, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [rft, PATCH v1 4/4] kernel.h: Split out ARRAY_SZIE()
Date: Sun, 30 Oct 2022 23:52:26 +0200 [thread overview]
Message-ID: <Y17yGm93EV1YrjAX@smile.fi.intel.com> (raw)
In-Reply-To: <Y1z697DtIBdp+Z9C@p183>
On Sat, Oct 29, 2022 at 01:05:43PM +0300, Alexey Dobriyan wrote:
> On Tue, Oct 25, 2022 at 11:20:10AM +0300, Andy Shevchenko wrote:
> > On Mon, Oct 24, 2022 at 09:14:29PM +0300, Alexey Dobriyan wrote:
> > > On Mon, Oct 24, 2022 at 07:05:18PM +0300, Andy Shevchenko wrote:
> > > > On Mon, Oct 24, 2022 at 06:44:50PM +0300, Alexey Dobriyan wrote:
> > > > > > include/linux/array_size.h | 13 +++++++++++++
> > > > >
> > > > > All of this is pessimisation unless you're removing
> > > > >
> > > > > +#include <linux/array_size.h>
> > > > >
> > > > > from kernel.h which you aren't doing.
> > > > >
> > > > > container_of.h is just as silly.
> > > > >
> > > > > kernel.h might need _some_ cleanup (like panic and tainted stuff) which
> > > > > is rarely used but ARRAY_SIZE()?
> > > >
> > > > Are you suggesting to slow down compilation with inclusion of tons of unneeded
> > > > stuff in the zillions of drivers?
> > > >
> > > > Or you are talking that we need to abandon most of the headers and combine
> > > > everything into kernel.h? I think this is what is silly.
> > >
> > > It hard to escape kernel.h so you will be including it anyway.
> >
> > It's very important to not include it in the headers.
> >
> > And this split helps to it a lot. We have container_of() or array_size() used
> > in macros and/or inliners that are usually appears in the headers. And if you
> > know what dependency hell means, the kernel.h brings to it a huge mess.
> >
> > So, try to be constructive, okay?
> >
> > > Unless you delete, say, kstrtox.h from kernel.h, it is pointless busywork.
>
> I'm very constructive.
>
> Parsing 1 define is faster than opening/reading/closing a file to parse
> 1 define (it's 2 defines because of header guard).
>
> Therefore extracting 1 macro into separate file without obvious future
> growth is a pessimisation.
You are looking at it at the wrong side. The opening one file inside a single
file maybe a way to slow down the compilation, but cleaning up the _headers_
from kernel.h and similar mess is a definite win.
Ingo, for example, unwounded the thread coil for the scheduler code with a
significant win. And his work exactly shows why it's right way to go.
> And if you delete #include <array_size.h> from kernel.h and fix all
> compile failures (which you aren't doing apparently) backporters will
> hate you for life.
It would need some time to have kernel.h to be hanging as is before we can
start cleaning the mess our of it. I prefer to kill the whole header or leave
there only really _kernel_ parts.
> I've tried to delete kstrtox.h, and even allnoconfig had dozens of
> failures.
So, help us and fix them!
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-10-30 21:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 15:44 [rft, PATCH v1 4/4] kernel.h: Split out ARRAY_SZIE() Alexey Dobriyan
2022-10-24 16:05 ` Andy Shevchenko
2022-10-24 16:06 ` Andy Shevchenko
2022-10-24 18:14 ` Alexey Dobriyan
2022-10-25 8:20 ` Andy Shevchenko
2022-10-29 10:05 ` Alexey Dobriyan
2022-10-30 21:52 ` Andy Shevchenko [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-10-24 13:24 [rft, PATCH v1 1/4] kernel.h: Move READ/WRITE definitions to <linux/types.h> Andy Shevchenko
2022-10-24 13:24 ` [rft, PATCH v1 4/4] kernel.h: Split out ARRAY_SZIE() Andy Shevchenko
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=Y17yGm93EV1YrjAX@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
/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