From: Ingo Molnar <mingo@elte.hu>
To: Grant Grundler <grundler@parisc-linux.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Arjan van de Ven <arjan@infradead.org>,
Rene Herman <rene.herman@keyaccess.nl>,
Bjorn Helgaas <bjorn.helgaas@hp.com>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Len Brown <lenb@kernel.org>, Frans Pop <elendil@planet.nl>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org,
Adam Belay <abelay@mit.edu>, Avuton Olrich <avuton@gmail.com>,
Karl Bellve <karl.bellve@umassmed.edu>,
Willem Riede <wriede@riede.org>,
Matthew Hall <mhall@mhcomputing.net>,
Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [patch 2/2] PNP: don't check disabled PCI BARs for conflicts in quirk_system_pci_resources()
Date: Wed, 1 Oct 2008 10:26:03 +0200 [thread overview]
Message-ID: <20081001082603.GA31009@elte.hu> (raw)
In-Reply-To: <20081001061328.GD7348@colo.lackof.org>
* Grant Grundler <grundler@parisc-linux.org> wrote:
> On Tue, Sep 30, 2008 at 12:51:07PM -0700, Linus Torvalds wrote:
> ....
> > But I think we could add a separate notion of a dependancy point, and have
> > a setup where we describe "initcall X needs to happen before point A" and
> > "initcall Z needs to happen after point A".
> >
> > And then we can create a separate set of these dependency points, so that
> > X and Y don't have to know about each other, they just have to have some
> > knowledge about some common synchronization point - one that exists
> > regardless of whether X or Y are even compiled in!
>
> We already do this today. :)
> Definitions are in include/linux/init.h.
> Point A would be "early" ("run before initialing SMP")
> The rest could use better definitions and AFAICT aren't that much better
> than being named "Point B".
the structural problem with the current level-based initcall design is
that the current dependencies are implicit (not spelled out clearly
anywhere in the source code), and bugs in them are often fixed by
experimenting around (seeing whether it breaks), not by design.
Changing it is a ton of work, and the risks of touching that code might
eclipse any (often marginal) advantages a new scheme has. Today boot
code runs only once and it is one of the most under-tested pieces of
kernel code. Boot code's quality and robustness is at least 1 order of
magnitude worse than regular kernel code.
But to play the devil's advocate: users have so many problems with weird
races in boot code today _already_, wouldnt it be better to expose boot
code to more variations, to put it under environmental pressure that
ultimately improves its quality?
Init code is often reused during suspend/resume, so by introducing more
flexibility into initcalls maybe we create enough pressure to fix them
when it's far easier to fix them. (after bootup - fixing after-resume
bugs is much harder because often the console is turned off and no
significant BIOS code ran.)
Today moving an initcall to another level has unknown effects and
nothing warns about broken dependencies but a bootup crash (often only
triggering under a specific .config), or a non-working device or some
other regression.
That is rather fragile and i doubt anyone can argue the opposite.
The question of whether explicit dependencies are better is another
question and up to debate:
in the long run it is _IMHO_ more robust to express explicit
dependencies close to the init functions, in the source code:
initcall_depends_on(this_driver, memory_init);
initcall_depends_on(this_driver, io_resources_init);
than to rely on the implicit (and undocumented and often forgotten)
dependencies we have currently.
For example ordering an initcall to after PNP init would be trivial,
we'd add this to the init dependency list:
initcall_depends_on(this_driver, pnp_init);
With the current scheme we have to find some other integer 'level' and
hope that moving this initcall to that new level does not break other,
implicit dependencies.
And note that once we start doing explicit dependencies, we could
automate much of it: if a piece of .o uses a set of symbols that makes
it rather clear which subsystems it has to rely on. Say it uses
kmalloc() then it should depend on memory_init() done.
Ingo
next prev parent reply other threads:[~2008-10-01 8:27 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-29 15:53 [patch 0/2] don't check disabled PCI BARs for conflicts with PNP devices Bjorn Helgaas
2008-09-29 15:56 ` [patch 1/2] PCI: add pci_resource_enabled() Bjorn Helgaas
2008-09-29 15:57 ` [patch 2/2] PNP: don't check disabled PCI BARs for conflicts in quirk_system_pci_resources() Bjorn Helgaas
2008-09-29 16:34 ` Linus Torvalds
2008-09-29 18:31 ` Rene Herman
2008-09-29 19:13 ` Linus Torvalds
2008-09-30 9:19 ` Rene Herman
2008-09-30 14:48 ` Linus Torvalds
2008-09-30 15:57 ` Rene Herman
2008-09-30 16:29 ` Linus Torvalds
2008-09-30 17:10 ` Linus Torvalds
2008-09-30 17:21 ` Linus Torvalds
2008-09-30 19:29 ` Rene Herman
2008-09-30 19:37 ` Rene Herman
2008-09-30 19:44 ` Linus Torvalds
2008-09-30 20:48 ` Rene Herman
2008-09-30 19:38 ` Ingo Molnar
2008-09-30 19:51 ` Linus Torvalds
2008-09-30 19:54 ` Arjan van de Ven
2008-09-30 20:01 ` Ingo Molnar
2008-10-01 6:13 ` Grant Grundler
2008-10-01 8:26 ` Ingo Molnar [this message]
2008-10-06 5:34 ` Grant Grundler
2008-10-01 15:14 ` Linus Torvalds
2008-10-01 16:21 ` Yinghai Lu
2008-09-30 20:05 ` Rolf Eike Beer
2008-10-01 8:52 ` Ingo Molnar
2008-09-30 18:01 ` Linus Torvalds
2008-09-30 18:13 ` Linus Torvalds
2008-09-30 19:51 ` Rene Herman
2008-09-30 19:16 ` Bjorn Helgaas
2008-09-30 19:12 ` Bjorn Helgaas
2008-10-01 20:18 ` Bjorn Helgaas
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=20081001082603.GA31009@elte.hu \
--to=mingo@elte.hu \
--cc=abelay@mit.edu \
--cc=arjan@infradead.org \
--cc=avuton@gmail.com \
--cc=bjorn.helgaas@hp.com \
--cc=elendil@planet.nl \
--cc=grundler@parisc-linux.org \
--cc=jbarnes@virtuousgeek.org \
--cc=karl.bellve@umassmed.edu \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mhall@mhcomputing.net \
--cc=rene.herman@keyaccess.nl \
--cc=rjw@sisk.pl \
--cc=sam@ravnborg.org \
--cc=torvalds@linux-foundation.org \
--cc=wriede@riede.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