From: Ingo Molnar <mingo@kernel.org>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>
Subject: Re: [PATCH/RFC] headers: drop 2 #included headers from <linux/interrupt.h>
Date: Fri, 16 Feb 2018 08:59:42 +0100 [thread overview]
Message-ID: <20180216075942.kmgdyvmluke2s5vg@gmail.com> (raw)
In-Reply-To: <b24b9ec8-4970-65f5-759a-911d4ba2fcf0@infradead.org>
* Randy Dunlap <rdunlap@infradead.org> wrote:
> Does anyone know or see why <linux/interrupt.h> needs <linux/linkage.h> or
> <linux/preempt.h>? There are no direct uses in <linux/interrupt.h> AFAICT.
These are likely historical, plus it's a classic 'tragedy of the commons'
scenario: it's easy to take away from the "public good" of "clean header
dependencies" and very hard to add to it:
- it's very easy to add a new #include line
- it's very hard to remove one, not just due to the 2^10000 complex Kconfig
space, but due to 99% of the developers not testing cross-arch builds
(and we don't want to require them to do it)
- the cost of getting the removal wrong is high (the build breaks for many
people who will be unhappy at the person removing the header), while the
benefit of the removal is low in isolation
Then apply this dynamic for more than 20 years and we get a spaghetti:
triton:~/tip> grep -c '#include <' include/linux/*.h | sort -n -t: -k +2 | tail -20
include/linux/device.h:15
include/linux/ide.h:16
include/linux/module.h:16
include/linux/acpi.h:17
include/linux/filter.h:17
include/linux/init_task.h:17
include/linux/mmzone.h:17
include/linux/cgroup.h:18
include/linux/nfs_fs.h:18
include/linux/sched.h:18
include/linux/irq.h:19
include/linux/pci.h:19
include/linux/perf_event.h:23
include/linux/blkdev.h:25
include/linux/kvm_host.h:26
include/linux/mm.h:26
include/linux/netdevice.h:26
include/linux/skbuff.h:26
include/linux/isdn.h:27
include/linux/fs.h:39
Plus there's collateral damage as well: there's countless primitives that were
forced into the CPP macro space because the header dependencies were too hard.
Such code is not just harder to read and maintain, it's more fragile to macro
substitution bugs and it's less type safe as well.
I'd argue that due to the basic human dynamics here this calls for tooling help.
In the meanwhile I've applied your patch to tip:core/headers and will do full
build testing + fixing, should anything break.
Thanks,
Ingo
next prev parent reply other threads:[~2018-02-16 7:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-16 0:49 [PATCH/RFC] headers: drop 2 #included headers from <linux/interrupt.h> Randy Dunlap
2018-02-16 7:59 ` Ingo Molnar [this message]
2018-02-25 23:19 ` Rasmus Villemoes
2018-02-26 7:59 ` Ingo Molnar
2018-02-16 9:45 ` [tip:core/headers] headers: Drop two " tip-bot for Randy Dunlap
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=20180216075942.kmgdyvmluke2s5vg@gmail.com \
--to=mingo@kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rdunlap@infradead.org \
--cc=tglx@linutronix.de \
/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