Re: MacOS X equivalent of swapon/swapoff?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com G'day Godfrey and Alison, Sam On 13/10/2006, at 8:46 AM, Godfrey van der Linden <gvdl@mac.com> wrote: I'd like to come at this problem a little differently. Are you a kernel hacker? It may be possible to modify the IOMediaBSDClient to stall I/O's for a few seconds until a convenient time in the future, this should work without to many problems. It seems to me that this is what you are really trying to do? Is that correct? Godfrey On 11/10/2006, at 04:08 , Alison Cassidy wrote: 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). Right. I'll never quiet *all* disk activity; all I can hope for is to minimize it somehow. 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. Right (and thanks John and Graham for the info there). I'd considered messing about with dynamic_pager but wouldn't like to modify the boot args nor kill it outright for very obvious reasons. I need to look into the workings of the paging daemon some more ... _______________________________________________ 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... Would you actually want to modify/replace the IOMediaBSDClient at all? I've been down that path before and it's a maintenance nightmare! You could create a standard media filter to match on all the system's IOMedia objects. Each of those would create its own IOMedia child for IOMediaBSDClient to match on and it would simply pass requests straight through. Built into the same driver you'd have a single controller object that matches on IOResources and publishes an API through a char device. The top level controller would have a read-write lock that it shares with all the filter object instances. They all take it in read mode to do their I/Os, but when you tell the controller to pause the I/O stream, it'd take the lock in write mode until you tell it to release it again. You'd want to make sure to do nothing in the interim that depends on the I/O subsystem, or you'd deadlock very quickly. You'd somehow have to ensure that all the pages containing code you need to execute are in-core as well. If the purpose is to allow I/Os from your own special user space process to proceed, you could use proc_selfname() to allow them to pass through your IOMedia filters. If it's for a one-off solution or for research purposes, then it seems do-able. It'd certainly make for a fun little project! This email sent to site_archiver@lists.apple.com
participants (1)
-
Sam Vaughan