Re: O_DIRECT in freebsd - Mailing list pgsql-hackers

From Sean Chittenden
Subject Re: O_DIRECT in freebsd
Date
Msg-id 20030623030039.GL97131@perrin.int.nxad.com
Whole thread Raw
In response to Re: O_DIRECT in freebsd  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
> > > What about cache coherency problems with other backends not
> > > opening with O_DIRECT?
> > 
> > If O_DIRECT introduces cache coherency problems against other
> > processes not using O_DIRECT then the whole idea is a nonstarter,
> > but I can't imagine any kernel hackers would have been stupid
> > enough to allow that to happen ...

Cache coherency isn't an issue, read() called on a fd that has
O_DIRECT set on it will pull data from the FS cache if a write has
occurred to the file pointed to by the reading/writing fd (though the
write of that page gets done immediately and isn't postponed,
rationale for that is still pending).

> Seeing how the buffer exists in user space, I would be interested
> how they prevent coherency problems with good performance --- maybe
> they map the same page into multiple processes --- that would be
> interesting, though it would require some locking.

It's in src/kern/vfs_bio.c, src/ufs/ffs_vnops.c, src/ufs/ffs_rawread.c

http://lists.freebsd.org/pipermail/cvs-all/2003-March/000226.html

phk's likely to revamp some of the FS buffer cache in FreeBSD 6, but
the userland API will remain stable (it'll just get more efficient in
6, not that it's not fast as is).

http://lists.freebsd.org/pipermail/cvs-all/2003-March/000261.html

-sc

-- 
Sean Chittenden


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Two weeks to feature freeze
Next
From: Tom Lane
Date:
Subject: Re: O_DIRECT in freebsd