Re: We really ought to do something about O_DIRECT and data=journalled on ext4

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: We really ought to do something about O_DIRECT and data=journalled on ext4
Дата
Msg-id 4CF94B2B.7060001@agliodbs.com
обсуждение исходный текст
Ответ на Re: We really ought to do something about O_DIRECT and data=journalled on ext4  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: We really ought to do something about O_DIRECT and data=journalled on ext4  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
All,

So, I've been doing some reading about this issue, and I think
regardless of what other changes we make we should never enable O_DIRECT
automatically on Linux, and it was a mistake for us to do so in the
first place.

First, in the Linux docs for open():

=========

In summary, O_DIRECT is a potentially powerful tool that should be used
with caution.  It is recommended that applications treat use of O_DIRECT
as a performance option which is disabled by default.

=========

Second, Linus has a quote about O_DIRECT that I think should serve as an
indicator to us that directIO will never be beneficial-by-default on
Linux, and might even someday be desupported:

============

The right way to do it is to just not use O_DIRECT.

The whole notion of "direct IO" is totally braindamaged. Just say no.
This is your brain: OThis is your brain on O_DIRECT: .
Any questions?

I should have fought back harder. There really is no valid reason for EVER
using O_DIRECT. You need a buffer whatever IO you do, and it might as well
be the page cache. There are better ways to control the page cache than
play games and think that a page cache isn't necessary.

So don't use O_DIRECT. Use things like madvise() and posix_fadvise()
instead.
    Linus
=============



--                                  -- Josh Berkus                                    PostgreSQL Experts Inc.
                        http://www.pgexperts.com
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Patch to add a primary key using an existing index
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Patch to add a primary key using an existing index