Subject: Re: LKMs (was Re: IPSEC in GENERIC)
To: None <tech-kern@NetBSD.org>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-kern
Date: 02/21/2006 09:48:21
"Valeriy E. Ushakov" wrote:

> On Mon, Feb 20, 2006 at 06:41:59 -0800, Garrett D'Amore wrote:
> 
> > performance of binary linked vs. static will vary from platform to
> > platform, but yes, I think generally the benefits outweigh the
> > costs.  IMO.
> 
> And given that to access driver or filesystem code the kernel already
> uses function pointers anyway, I'm not even sure there is any
> performance penalty after the LKM is loaded.  The code is not PIC, it
> needs to be relocated before being loaded (that's why we need ld(1)
> for LKMs) into the kernel, so there's no PIC indirection price to
> pay).

MIPS needs to use -mlong-calls to compile LKMs, and PowerPC and ARM use
trampolines to call functions external to the LKM, so there's at least
some performance hit for those architectures.

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Support and Service:         http://www.wasabisystems.com/