----- Original Message -----
From: "Dean Michael C. Berris" <[EMAIL PROTECTED]>
To: "Philippine Linux Users' Group (PLUG) Technical Discussion List"
<[email protected]>
Sent: Monday, January 16, 2006 3:07 PM
Subject: Re: [plug] Reserving memory from buffer cache for kmalloc
How about modifying the kernel driver by allocating a static buffer and
use that instead of kmalloc() for storing whatever info you need from
the kernel driver?
that is highly discourage when allocating a static buffer in a device driver
programming... unlike with user-space processes, code executing in
kernel-space dont have large nor dynamically growing stack... it has a small
fixed-size stack which is around 8kb on 32-bit machines... kmalloc() and
vmalloc() are still the recommended choice...
There's also the userland abstraction of a daemon
dedicated to waiting for input from a kernel driver, and the daemon
doing the actual caching/storage instead of relying on the kernel to
store the information.
This way, the kernel driver will only be writing to a pipe instead of
allocating memory for the kernel to take care of. Of course, this
solution means you need to watch out for a lot of things -- granted that
you'll be using IPC mechanisms still subject to kernel scheduling and
interference.
At least that will alleviate you of the problem that is kmalloc. But
that is if you're willing to go through all of the trouble of creating a
daemon to stay away from kernel malloc.
you can do that if your device driver is not interrupt sensitive or
DMA-capable memory sensitive or can afford to sleep while allocating a
memory...
migs,
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph