aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-06-27 18:59:17 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-06-27 18:59:17 +0000
commit3c71244b74b164e6d86654cab6fd0df0de1d3312 (patch)
tree8f958c524d65cec7f2e2f4d76b1eb9545cbd7553 /src
parent33b4ad66c9279a4eff1155031147c18613a691a0 (diff)
downloadpostgresql-3c71244b74b164e6d86654cab6fd0df0de1d3312.tar.gz
postgresql-3c71244b74b164e6d86654cab6fd0df0de1d3312.zip
Put #ifdef NOT_USED around posix_fadvise call. We may want to resurrect
this someday, but right now it seems that posix_fadvise is immature to the point of being broken on many platforms ... and we don't have any benchmark evidence proving it's worth spending time on.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/xlog.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index e540ba672c9..3435b210a45 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.241 2006/06/22 20:42:57 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.242 2006/06/27 18:59:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2153,7 +2153,16 @@ XLogFileClose(void)
{
Assert(openLogFile >= 0);
-#if defined(HAVE_DECL_POSIX_FADVISE) && defined(POSIX_FADV_DONTNEED)
+ /*
+ * posix_fadvise is problematic on many platforms: on older x86 Linux
+ * it just dumps core, and there are reports of problems on PPC platforms
+ * as well. The following is therefore disabled for the time being.
+ * We could consider some kind of configure test to see if it's safe to
+ * use, but since we lack hard evidence that there's any useful performance
+ * gain to be had, spending time on that seems unprofitable for now.
+ */
+#ifdef NOT_USED
+
/*
* WAL segment files will not be re-read in normal operation, so we advise
* OS to release any cached pages. But do not do so if WAL archiving is
@@ -2163,10 +2172,13 @@ XLogFileClose(void)
* While O_DIRECT works for O_SYNC, posix_fadvise() works for fsync()
* and O_SYNC, and some platforms only have posix_fadvise().
*/
+#if defined(HAVE_DECL_POSIX_FADVISE) && defined(POSIX_FADV_DONTNEED)
if (!XLogArchivingActive())
posix_fadvise(openLogFile, 0, 0, POSIX_FADV_DONTNEED);
#endif
+#endif /* NOT_USED */
+
if (close(openLogFile))
ereport(PANIC,
(errcode_for_file_access(),