Re: How to know when memory pages are swapped?
Re: How to know when memory pages are swapped?
- Subject: Re: How to know when memory pages are swapped?
- From: Godfrey van der Linden <email@hidden>
- Date: Wed, 4 May 2005 14:04:48 -0700
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?
Godfrey
On 05/04/2005, at 13:15 , Stéphane Letz wrote:
Le 4 mai 05, à 22:06, Godfrey van der Linden a écrit :
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.
Cheers
Godfrey
On 05/04/2005, at 12:12 , Stéphane Letz wrote:
Hi,
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?
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
What is this _P1003_1B_VISIBLE defined for actually? is this for
kernel code only?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden