Re: O_DIRECT in freebsd - Mailing list pgsql-hackers

From Sean Chittenden
Subject Re: O_DIRECT in freebsd
Date
Msg-id 20030617071121.GI97131@perrin.int.nxad.com
Whole thread Raw
In response to O_DIRECT in freebsd  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
> I noticed this in the FreeBSD 5.1 release notes:
> 
> "A new DIRECTIO kernel option enables support for read operations
> that bypass the buffer cache and put data directly into a userland
> buffer. This feature requires that the O_DIRECT flag is set on the
> file descriptor and that both the offset and length for the read
> operation are multiples of the physical media sector size. [MERGED]"
> 
> MERGED means that it should also appear in FreeBSD 4.9.
> 
> Will PostgreSQL pick this up automatically, or do we need to add
> extra checks?

Extra checks, though I'm not sure why you'd want this.  This is the
equiv of a nice way of handling raw IO for read only
operations... which would be bad.  Call me crazy, but unless you're on
an embedded device with a non-existent FS cache or are Oracle and are
handling the IO buffer in user space, the buffer cache is what helps
speed up PostgreSQL since PostgreSQL leaves all of the caching
operations and optimization/alignment of pages up to the OS (much to
the behest of madvise() which could potentially speed up access of the
VM, but I won't get into that... see TODO.mmap).

-sc

-- 
Sean Chittenden


pgsql-hackers by date:

Previous
From: "Shridhar Daithankar"
Date:
Subject: Re: Our FLOAT(p) precision does not conform to spec
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: O_DIRECT in freebsd