[Ksummit-discuss] [TECH TOPIC] Addressing complex dependencies and semantics (v2)

Luis R. Rodriguez mcgrof at kernel.org
Wed Aug 10 16:42:22 UTC 2016


On Wed, Aug 10, 2016 at 05:21:24PM +0200, Jörg Rödel wrote:
> On Tue, Aug 09, 2016 at 08:06:52PM +0200, Luis R. Rodriguez wrote:
> > If the semantics of order would be in place at compile time linker tables
> > could be used to link at compile time in such a way that order is respected
> > so linking at compile time is possible, you however would need an explicit
> > order mentioned, which IMHO would be good.
> > 
> > How would linking the kernel at boot time happen so that it can
> > enable proper ordering ?
> 
> The idea was basically to compile module stuff always as a module and
> put the modules that should be 'built-in' into the kernel-image and let
> the module-code link them into the kernel at boot time automatically in
> the right order, as the required symbols become visible.
> 
> But thats a rather intrusive change and I am not sure the benefits
> outweight the conversion cost.

Yeah linking at boot sounds intrusive but the logic of re-using the module
ordering scheme for delaying selective built-in inits does not sound so bad to
me. I believe you are right that if the existing simple module ordering scheme
suffices for module_init() order, it should also be possible to delay such
built-in init so long as the same module ordering is followed. With a bit of
stuffing the driver symbol dep map stuff into built-in, it should be in theory
possible to have something similar and simple for built-in, with already well
tested coverage. Also, if there are flaws with module order, or simply we know
we want something better / different for built-in it begs the question if we
can borrow similar logic for modules as well.

I'd be surprised if no one had thought of this or tried this before though --
have we not ?

  Luis


More information about the Ksummit-discuss mailing list