On Tue, 16 Oct 2001, David Olofson wrote:
> 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. Ok, did not know that. :) That was the crux of my question, and I thank you for answering it. Do the GFP_KERNEL and GFP_USER flags have any effect on this? -Calin > > > //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/ > -- [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/
