Re: O_DIRECT in freebsd - Mailing list pgsql-hackers

From Tom Lane
Subject Re: O_DIRECT in freebsd
Date
Msg-id 15372.1056335103@sss.pgh.pa.us
Whole thread Raw
In response to Re: O_DIRECT in freebsd  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: O_DIRECT in freebsd  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: O_DIRECT in freebsd  (Sean Chittenden <sean@chittenden.org>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Basically, I think we need free-behind rather than O_DIRECT.

There are two separate issues here --- one is what's happening in our
own cache, and one is what's happening in the kernel disk cache.
Implementing our own free-behind code would help in our own cache but
does nothing for the kernel cache.

My thought on this is that for large seqscans we could think about
doing reads through a file descriptor that's opened with O_DIRECT.
But writes should never go through O_DIRECT.  In some scenarios this
would mean having two FDs open for the same relation file.  This'd
require moderately extensive changes to the smgr-related APIs, but
it doesn't seem totally out of the question.  I'd kinda like to see
some experimental evidence that it's worth doing though.  Anyone
care to make a quick-hack prototype and do some measurements?
        regards, tom lane


pgsql-hackers by date:

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