Re: More linker magic..

Linus Torvalds (torvalds@transmeta.com)
Tue, 3 Aug 1999 12:59:56 -0700 (PDT)


On 3 Aug 1999, Andi Kleen wrote:
>
> Would it make sense to add a "priority" argument to __initcall ?
> This would allow to express simple dependencies between modules. Of course
> this could be emulated by immediate functions that do the traditional manual
> initialization.

I've considered it, but there's no way I'll accept more than a small
number of priorities. And no way in hell that I'll consider real
dependencies to be acceptable.

What would be acceptable is something like:
- three priorities: "CPU initialization", "bus initialization" and
"driver initialization"
- within each priority, the linking order can be used to sub-prioritize.

Anything more complex than the above is almost certainly not a good idea,
in my opinion. In fact, I'm not convinced even the above is acceptable. I
do not want people to introduce dependencies: if there are dependencies
then you might as well use the old-style "real initialization" sequence.
The whole point of automatic initialization is to make it easy to add
independent stuff.

So I think the "automatic initialization" is really only useful for
anonymous stuff. Device drivers, normal kernel threads, that kind of
things. Anything more complicated might as well just do proper
initialization, and there's no point in trying to extend a clever setup
further than really needed.

It's not that the old scheme didn't work. It worked fine. It just wasn't
very pretty. The new scheme should be able to remove the ugly parts, it's
not meant to completely supplant the old regular initialization sequence.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/