Re: F_NOCACHE vs F_GLOBAL_NOCACHE
Re: F_NOCACHE vs F_GLOBAL_NOCACHE
- Subject: Re: F_NOCACHE vs F_GLOBAL_NOCACHE
- From: Sam Vaughan <email@hidden>
- Date: Fri, 21 Sep 2007 09:49:35 +1000
On 21/09/2007, at 5:04 AM, email@hidden wrote:
On current systems the F_NOCACHE state is stored per-vnode. This
presents a problem when two programs open two different descriptors
for the same file. The descriptors, by definition, share the same
vnode. So, if program A sets F_NOCACHE on its descriptor, its
setting is reflected in program B's descriptor. Worse yet, if
program A exits without clearing the flag, it remains in effect until
the vnode is recycled. Less than ideal.
Hi Quinn,
That last part is really nasty!
A nice side effect of your current global setting is that you avoid
the cache coherency issue. With per-descriptor flags, a buffered
writer can write data that won't be seen by an unbuffered reader.
This caveat is hopefully familiar to authors of direct I/O code, but
it will probably warrant a warning in the fcntl man page.
Have you guys considered adding an O_DIRECT flag, if nothing else
just for the portability benefit it would provide?
Sam
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden