Subject: Questions about memory allocation for device drivers.
To: None <,,>
From: Mark Milligan <>
List: netbsd-ports
Date: 08/23/2001 09:13:54
I have been looking thru the kernel code trying to understand how the ker=
memory allocation works etc. and have noticed a few things.=20

When the autoconfig routine installs a device driver it mallocs some memo=
for the softc device structure and this is passed to the driver to use. =20

see: sys/kern/subr_autoconf.c  config_attach()

The malloc routine allocates memory from kernel space, I am not sure if t=
memory is wired down or not.  I have noticed that some device drivers use=
memory for buffers (the 16550 com.c driver com_intr()  )  while others us=
e the
bus_dma functions ( ethernet etc.) to guarantee they have wired down memo=

Is the softc driver memory wired down? or will it page?  It seems to me i=
should be wired down and should not page.  If they page should the autoco=
routine force the memory to be wired down?  This may improve the performa=
nce of=20
device drivers.

Also shouldnt the ISR routines be wired down so they do not page?  My
understanding is that kernel code can be paged in and out.

Thanks in advance
Mark Milligan
Real Time Systems Inc.