• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: F_NOCACHE vs F_GLOBAL_NOCACHE
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: F_NOCACHE vs F_GLOBAL_NOCACHE
      • From: Mark Day <email@hidden>
  • Prev by Date: F_NOCACHE vs F_GLOBAL_NOCACHE
  • Next by Date: Re: F_NOCACHE vs F_GLOBAL_NOCACHE
  • Previous by thread: F_NOCACHE vs F_GLOBAL_NOCACHE
  • Next by thread: Re: F_NOCACHE vs F_GLOBAL_NOCACHE
  • Index(es):
    • Date
    • Thread