Re: mmap modified data not to be swapped out but saved?
Re: mmap modified data not to be swapped out but saved?
- Subject: Re: mmap modified data not to be swapped out but saved?
- From: Ben Dougall <email@hidden>
- Date: Sun, 3 Oct 2004 21:59:10 +0100
On Saturday, October 2, 2004, at 10:58 pm, Dylan McNamee wrote:
Ben Dougall asked:
with mmap once you've read in some of a file and made some
modifications is there anyway to avoid those modifications being
swapped out to the backing store? what would be preferable is in the
event of the system needing more memory, rather than swapping out
those
modifications, save them directly to the original file -- is that what
happens now, by default maybe, or is there anyway of doing that?
While I haven't examined Darwin's code lately, I am pretty familiar
with
the Mach's VM code from years past, and my memory says that what you
want to have happen is supported. (At pageout, "dirty" pages are
written back to the file backing the mapped region, which is a
file-backed
Memory Object). Revisiting the mmap man page reminds me that this
might only be the case if the region is mmapped including the
MAP_SHARED flag.
A simple experiment should validate this hypothesis: try it, and drive
some paging!
right, it'd certainly make sense if that is an option as otherwise, if
the modified data is definitely for saving, it could easily get saved
to the drive, then loaded again, unnecessarily, then saved to the file.
rather than just straight to the file.
ok thanks, ben.
_______________________________________________
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