On Tuesday 16 October 2001 14:39, Calin A. Culianu wrote:
> Hey, this may be a basic question, but what steps should a programmer
> take when allocating memory in a real-time module during init_module()
> to ensure that the memory is A) available more-or-less immediately

kmalloc(), just as (nearly) every other memory allocation API, implies 
that memory is ready for use as soon as the call returns. Of course, you 
might actually get swapped out memory in some implementations, but...


> and
> needs not be paged-in-on-use and B) the memory stays locked in RAM.

...memory allocated with kmalloc() is guaranteed to stay in physical RAM, 
as it's used by normal Linux ISRs and other places where response time is 
critical.

That is, when kmalloc() returns the memory is allocated, mapped and 
locked, and isn't going anywhere. If there isn't enough physical memory 
that can be freed (by swapping non-locked memory out, if required), the 
call fails.


//David Olofson --- Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
|      Multimedia Application Integration Architecture      |
| A Free/Open Source Plugin API for Professional Multimedia |
`----------------------------> http://www.linuxdj.com/maia -'
.- David Olofson -------------------------------------------.
| Audio Hacker - Open Source Advocate - Singer - Songwriter |
`-------------------------------------> http://olofson.net -'
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to