@@ -85,13 +85,12 @@ typedef uint32 TimeLineID;
8585
8686/*
8787 *Because O_DIRECT bypasses the kernel buffers, and because we never
88- *read those buffers except during crash recovery, it is a win to use
89- *it in all cases where we sync on each write().We could allow O_DIRECT
90- *with fsync(), but because skipping the kernel buffer forces writes out
91- *quickly, it seems best just to use it for O_SYNC. It is hard to imagine
92- *how fsync() could be a win for O_DIRECT compared to O_SYNC and O_DIRECT.
93- *Also, O_DIRECT is never enough to force data to the drives, it merely
94- *tries to bypass the kernel cache, so we still need O_SYNC or fsync().
88+ *read those buffers except during crash recovery or if wal_level != minimal,
89+ *it is a win to use it in all cases where we sync on each write(). We could
90+ *allow O_DIRECT with fsync(), but it is unclear if fsync() could process
91+ *writes not buffered in the kernel. Also, O_DIRECT is never enough to force
92+ *data to the drives, it merely tries to bypass the kernel cache, so we still
93+ *need O_SYNC/O_DSYNC.
9594 */
9695#ifdef O_DIRECT
9796#define PG_O_DIRECT O_DIRECT