On 24 Oct 2008, at 04:31 AM, "Jonah H. Harris"
<jonah.harris@gmail.com> wrote:
> On Thu, Oct 23, 2008 at 10:36 PM, Greg Stark
> <greg.stark@enterprisedb.com> wrote:
>> I couldn't get async I/O to work on Linux. That is it "worked" but
>> performed
>> the same as reading one block at a time. On solaris the situation is
>> reversed.
>
> Hmm, then obviously you did something wrong, because my tests showed
> it quite well. Pull the source to iozone or fio.
I posted the source, feel free to point out what I did wrong. It did
work on solaris with and without o_direct so I didn't think it was a
bug in my code.
>> In what way is fadvise a kludge?
>
> non-portable, requires more user-to-system CPU, ... need I go on?
Well it's just as portable, they're both specified by posix. Actually
async I/o is in the real-time extensions so one could argue it's less
portable. Also before posix_fadvise there was plain old fadvise so
it's portable to older platforms too whereas async I/o isn't.
Posix_fadvise does require two syscalls and two trips to the buffer
manager. But that doesn't really make it a kludge if the resulting
code is cleaner than the async I/o code would be. To use async I/o we
would have to pin all the buffers we're reading which would be quite a
lot of code changes.
I did ask for feedback on precisely this point of whether two trips to
the buffer manager was a problem. It would have been nice to get the
feedback 6 months ago when I posted it instead of now two weeks before
feature freeze.