From owner-freebsd-chat Fri Mar 7 22:48:46 2003 Delivered-To: freebsd-chat@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 847BB37B401; Fri, 7 Mar 2003 22:48:43 -0800 (PST) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id C888243FB1; Fri, 7 Mar 2003 22:48:42 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from dialup-209.245.137.181.dial1.sanjose1.level3.net ([209.245.137.181] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 18rY8N-0004Py-00; Fri, 07 Mar 2003 22:48:40 -0800 Message-ID: <3E6991F4.F8A10E3A@mindspring.com> Date: Fri, 07 Mar 2003 22:47:16 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Damien Tougas Cc: Andrew Boothman , John Baldwin , freebsd-chat@freebsd.org Subject: Re: A question about kernel modules References: <3E69329B.2040803@cream.org> <200303072246.18636.damien@tougas.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a47f389623d165e9e85fa28d9a0e6709c62601a10902912494350badd9bab72f9c350badd9bab72f9c Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Damien Tougas wrote: > On Friday 07 March 2003 07:00 pm, Andrew Boothman wrote: > > >Nope. cdboot loads up a /boot/loader and you are free to load > > >whatever modules you want off the CD just as if you were booting > > >from a hard drive. That said, I personally favor static kernels > > >and only use modules when I'm testing things. > > > > I guess this is really the nub of the question. > > > > Why do you "personally favour" static kernels over modules? > > Yes, that really is the question. I have traditionally always done the same, > compiling everything into my kernel. I guess I am wondering what the point of > kernel modules are, and if they are considered to be a stable, viable way of > configuring my kernel. If there are good reasons why I should not use them > (or not use them in specific situations), I would be intersted in knowing > what those are. The dependency tracking sucks, and so does demand-loading. If you look at the module code with the idea of loading *at least one* ethernet driver before you could load IP, and having to load IP before you could load TCP, and then look at the code to see what this would take, you will be enlightened. There are also certain options which cause structure sizes to change, which are associated with particular things. As an example, the IPSEC stuff can't really be modularized, because there's per connection state that has to be there for it to be happy. Another issue having to do with structure size is that if the module you are trying to load was not compiled with the same options as the kernel you are trying to load it into, even if all the version stuff matches, including the proposed new versioning data, the structure sizes expected by the module and by the kernel can be different. A good example of this is something like "WITNESS" or "INVARIANTS", etc.. The fact that the API contracts are not as fixed as they should be adds to the uncertainty (e.g. there is no DDI or DKI, as such, in FreeBSD). Basically, it's not really "ready for prime time", in terms of third party binary-only modules, which is the most interesting use for them, by far. > > I, like you, tend to compile everything into my kernel but that's more > > out of habit than for any other reason as I have been compiling kernels > > since about 2.2.7 which I think pre-dates kernel modules. > > I don't know much about the technology behind kernel modules, but I get the > sense that people get used to doing things a certain way, and stick with it > because it is what they have always done, regardless if there is another way > (even if it might be technically better - although I am in no position to be > the judge of that in this situation). If something's in the kernel, proper, I'm guaranteed it woun't have a problem loading, so that when I need it, it will be there. With a module, theres an element of risk, due to reasons stated previously, and the reasons above. > >From a convenience standpoint, kernel modules seem much more practical to me. > > I like the idea of being able to load/unload device drivers, etc. at runtime. > I, however, have no idea what the impact is on things like stability and > performance. The normal performance cost is all interfaces being indirected through a pointer. For most interfaces, this overhead is there anyway, so that all access is uniform. For other things, like schedulers, for example, the functions are linked directly, so they have to be resolved at compile time. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message