Index: src/backend/access/transam/xlog.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/access/transam/xlog.c,v
retrieving revision 1.293
diff -r1.293 xlog.c
1923a1924,1932
>  *
>  * 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
>  * active, because archiver process could use the cache to read the WAL
>  * segment.  This is done by using posix_fadvise() where supported,
>  * otherwise the OS is not advised.
>  *
>  * While O_DIRECT works for O_SYNC, posix_fadvise() works for fsync() and
>  * O_SYNC, and some platforms only have posix_fadvise().
1955a1965,1969
> 		{
> #if defined(HAVE_DECL_POSIX_FADVISE) && defined(POSIX_FADV_DONTNEED)
> 			if (!XLogArchivingActive())
> 				posix_fadvise(openLogFile, 0, 0, POSIX_FADV_DONTNEED);
> #endif
1956a1971
> 		}
1978a1994,1998
> #if defined(HAVE_DECL_POSIX_FADVISE) && defined(POSIX_FADV_DONTNEED)
> 	if (!XLogArchivingActive())
> 		posix_fadvise(openLogFile, 0, 0, POSIX_FADV_DONTNEED);
> #endif
> 
2056a2077,2081
> #if defined(HAVE_DECL_POSIX_FADVISE) && defined(POSIX_FADV_DONTNEED)
> 	if (!XLogArchivingActive())
> 		posix_fadvise(openLogFile, 0, 0, POSIX_FADV_DONTNEED);
> #endif
> 
2376,2400d2400
< 	/*
< 	 * 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
< 	 * active, because archiver process could use the cache to read the WAL
< 	 * segment.
< 	 *
< 	 * 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 */
< 
