Re: MacOS X equivalent of swapon/swapoff?
Re: MacOS X equivalent of swapon/swapoff?
- Subject: Re: MacOS X equivalent of swapon/swapoff?
- From: "Justin C. Walker" <email@hidden>
- Date: Tue, 10 Oct 2006 10:51:52 -0700
On Oct 10, 2006, at 10:34 , Alison Cassidy wrote:
On Oct 10, 2006, at 10:24 AM, Justin C. Walker wrote:
On Oct 10, 2006, at 10:10 , Alison Cassidy wrote:
Does anyone know if there is a programmatic way of switching VM
on and off, similar to the way Linux does it? I've good reason to
do this (honest!) and need some way to disable VM for the
duration of running my app or at the least, ensure it doesn't
flush to disk at the wrong moment.
AFAIK, no OS that supports VM has such a feature. How would you
deal, within your app, with this problem: you are running, you
"turn off VM", the next instruction to be executed in your app
lies at the start of a page that, oops, is paged out?
Fair point. However, I'm assuming the kernel memory management will
deal accordingly in some sane manner. See; http://unixhelp.ed.ac.uk/
CGI/man-cgi?swapoff+2
Mac OS X is not Linux :-}
In any case, from that man page, I don't see how you can do both of
"quiet all disk activity" and avoid the problem I mention above
(which really isn't specific to your process; modern OSs have a lot
of processes that can fire at any time to handle the exigencies of
the moment; they need to be able to run, or the system crumbles).
How do you avoid this problem in Linux?
There may be more reasonable ways to solve your problem. Can you
be more specific about what you are trying to do?
I'm trying to quiet disk activity. If I could suspend the OS File
Manager temporarily, I would do so :) Right now, I'm even running a
separate pthread to sync() on a very regular basis to ensure that
the kernel doesn't build up too many dirty blocks which it would
otherwise flush in a flurry of disk activity. I'm doing some very
strange things indeed!
You could, as mentioned earlier in this thread, avoid enabling the
paging daemon. With sufficient memory, you could run a full system,
but things may start failing in strange ways without the elasticity
provided by a backing store. In case you haven't looked in depth at
the Mac OS X VM system, it's all handled by the paging daemon. There
is no path to disk (for this purpose) within the kernel.
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Absorption of Federal Funds
--------
Some people have a mental horizon of radius zero, and
call it their point of view.
-- David Hilbert
--------
_______________________________________________
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