site_archiver@lists.apple.com Delivered-To: Darwin-dev@lists.apple.com Godfrey On 05/04/2005, at 13:15 , Stéphane Letz wrote: Le 4 mai 05, à 22:06, Godfrey van der Linden a écrit : Cheers Godfrey On 05/04/2005, at 12:12 , Stéphane Letz wrote: Hi, from the #include <Kernel/sys/mman.h> __BEGIN_DECLS #ifdef _P1003_1B_VISIBLE int mlockall __P((int)); int munlockall __P((void)); #endif /* _P1003_1B_VISIBLE */ int mlock __P((const void *, size_t)); #ifndef _MMAP_DECLARED #define _MMAP_DECLARED void * mmap __P((void *, size_t, int, int, int, off_t)); #endif _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Yup this is basically the solution I was going to suggest. Keep a small pool of 'wired' memory around on the end of your I/O train. I'm afraid I'm not quite sure what the correct userland APIs are but I believe you are on the right track. You probably don't want to mlockall() in any case, but I'll guess p1003 is probably Posix 1003 spec (just a guess). I know that paging can be an issue, especially with audio, but an audio stream should be so hot that paging doesn't really occur. Have you been able to work out what pages are missing and why they are so cold? Perhaps a more complete analysis of page utilisation will reward you better then mlocking a bunch of pages? No. We have been asked for this functionality quite a number of times but there really is no good way for the kernel to notify and heat up code in a client app when it chooses to page out some data. I have to ask, what are you trying to achieve? There is usually someway of achieving a very similar effect. In there any way for an application to be "notified" when one of the memory pages it uses is swapped on the disk? Is there a way to install an handler for "page-out" event? I need to avoid page to be swapped because they are accessed in a real-time audio thread. I finally found that mlock/munlock functions are available for user space code. Is this correct? What is this _P1003_1B_VISIBLE defined for actually? is this for kernel code only? This email sent to site_archiver@lists.apple.com