Commit 7d23e0f8 authored by Bruce Momjian's avatar Bruce Momjian

Update C comment about O_DIRECT and fsync().

parent 06711de9
...@@ -85,13 +85,12 @@ typedef uint32 TimeLineID; ...@@ -85,13 +85,12 @@ typedef uint32 TimeLineID;
/* /*
* Because O_DIRECT bypasses the kernel buffers, and because we never * Because O_DIRECT bypasses the kernel buffers, and because we never
* read those buffers except during crash recovery, it is a win to use * read those buffers except during crash recovery or if wal_level != minimal,
* it in all cases where we sync on each write(). We could allow O_DIRECT * it is a win to use it in all cases where we sync on each write(). We could
* with fsync(), but because skipping the kernel buffer forces writes out * allow O_DIRECT with fsync(), but it is unclear if fsync() could process
* quickly, it seems best just to use it for O_SYNC. It is hard to imagine * writes not buffered in the kernel. Also, O_DIRECT is never enough to force
* how fsync() could be a win for O_DIRECT compared to O_SYNC and O_DIRECT. * data to the drives, it merely tries to bypass the kernel cache, so we still
* Also, O_DIRECT is never enough to force data to the drives, it merely * need O_SYNC/O_DSYNC.
* tries to bypass the kernel cache, so we still need O_SYNC or fsync().
*/ */
#ifdef O_DIRECT #ifdef O_DIRECT
#define PG_O_DIRECT O_DIRECT #define PG_O_DIRECT O_DIRECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment