Re: F_GLOBAL_NOCACHE not global?
Re: F_GLOBAL_NOCACHE not global?
- Subject: Re: F_GLOBAL_NOCACHE not global?
- From: Michael Smith <email@hidden>
- Date: Fri, 30 Oct 2009 12:55:58 -0700
I'm using fcntl(fd, F_GLOBAL_NOCACHE, 1) to set the global "no cache" flag on a file.
The changes do not seem to persist once I exit the process that sets the flag.
Is F_GLOBAL_NOCACHE really global or am I missing something?
It's global, not persistent.
F_NOCACHE requests that operations on the nominated descriptor not cause new pages to enter the cache.
F_GLOBAL_NOCACHE requests that operations on any descriptor that shares the same vnode not cause new pages to enter the cache.
Once all references to the vnode are released (open files, mappings, etc.) the vnode and thus the cache control state are discarded.
To answer the other half of your question; there is no way to mark a file such that its contents are never cached. Even when a file is marked with F_GLOBAL_NOCACHE, if the file is mapped and pages from that file are resident, they will be treated as cached pages in the case of read/write operations (this is necessary from a coherency perspective).
= Mike
-- True terror is to wake up one morning and discover that your high school class is running the country. -- Kurt Vonnegut
|
_______________________________________________
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