> > 2c. Eliminate "#ifdef MODULE" init.h, module.h, and,
> > eventually, almost everywhere.
> >
> > 2d. In the core kernel, THIS_MODULE would point to
> > a struct module rather than being NULL (eliminating
> > many little banches).
>
> I thought about doing this, but the branch cost IRL is trivial on
> modern processors with decent branch prediction (since it will almost
> always be the same way).
It's not about branch prediction, it's about the branch
instruction and readable code. Most code dependend on MODULE can
be made dependend on CONFIG_MODULE_UNLOAD, because the rest is
common or should be rewritten that way.
> > 5. At modprobe time, being able to decide to load a module
> > as non-removable to avoid loading .exit{,data} for a smaller
> > kernel footprint. This might only require insmod changes
> > for the user level insmod.
> Hmm, I already discard these if !CONFIG_MODULE_UNLOAD, but it'd be a
> cute hack to let the user do this.
No. That means dangling pointers everywhere. Remember dev_exit_p()
and why it was introduced.
> > 10. Move tracking of dependencies among loaded modules to
> > user land (and be able to reconstruct in some cases
> > from modules.dep).
>
> Personally, I think the userspace module loaders are clearly inferior,
> especially as you're gonna break userspace with almost every one of
> these changes. Sure, you can use a kernel-specific library to give
> you back the interface flexibility, but why? You gain complexity and
> your kernel doesn't get any smaller anyway.
>
> Anyway, I think supporting both doesn't make sense. Either the
> in-kernel module loader is better, in which case it should be kept, or
> it isn't in which case it should be junked.
At least resolving module name aliases to modules and options
hould be done in user space, because that's critical to auto
configuration and readable configuration of the system.
module_name_deamon anyone?
This resolving is clearly seperateable and might not even require
root privileges and can be done as a special user (passed as
kernel parameter and defaulting to UID 0), because we just need
to read a kind of database.
That reduces buffer overflow attacks and the like.
That resolving I'm really missing from the new scheme.
Regards
Ingo Oeser
-- Science is what we can tell a computer. Art is everything else. --- D.E.Knuth - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/