Re: [idea] request_module(const char *fmt, ...);

From: David Woodhouse (dwmw2@infradead.org)
Date: Wed Jan 12 2000 - 05:35:32 EST


tigran@sco.COM said:
> int request_module(const char *fmt, ...)

tigran@sco.COM said:
> Disadvantage:
> 0. an extra function call even if CONFIG_KMOD is not defined. This is
> not serious as request_module() is never called on a hot path (usually
> opening a device etc.)

> Advantages:

> 0. Code is not polluted with a multitude of #ifdef CONFIG_KMOD, thus
> making disassembly output look more immediately recognizeable.

> 1. No dependency on CONFIG_KMOD spread around the entire kernel. So,
> if you reconfigure the kernel changing CONFIG_KMOD, only the kernel/
> kmod.c is recompiled.

> Let me know your ideas and I shall knock up a patch this evening, if
> your feedback is positive.

I'd be inclined to change request_module to take multiple arguments, but still
to leave it defined as a NOP in the !CONFIG_KMOD case. That way, all the code
gets cleaned up, but you don't incur the extra function call cost.

I appreciate that the cost of that function call isn't exactly high - but it's
not exactly necessary either. When you change to/from CONFIG_KMOD, you expect
to have to recompile some files. It's not the end of the world.

Except in exceptional cases, run-time performance is far more important than
compilation time, surely?

--
dwmw2

- 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/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:20 EST