Skip site navigation (1) Skip section navigation (2)

Re: Free WAL caches on switching segments

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: Free WAL caches on switching segments
Date: 2006-01-12 05:22:41
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:

> > > > Here is a small patch to prevent undesired WAL file caching by kernel.
> > > > posix_fadvise(POSIX_FADV_DONTNEED) attempts to free cached pages and
> > > > the kernel will discard them in preference to other data caches.
> > > 
> > > On plenty of platforms, this won't even compile ...
> Yes, but we probably have to have a configure test to see if
> posix_fadvise exists too.  I will keep this for 8.2.

I think we can use _POSIX_ADVISORY_INFO to test if posix_fadvise exists.
Also, I added the check on whether WAL archiving is enabled, because
archivers might use the caches to read the WAL segment.

By the way, should we put posix_fadvise on the separated place with renaming
pg_fadvise? If we use posix_fadvise in other purposes, for example,
read-ahead control, the separation would be good to keep codes clean.

ITAGAKI Takahiro
NTT Cyber Space Laboratories

Attachment: xlog-with-fadvise.patch
Description: application/octet-stream (3.5 KB)

In response to


pgsql-patches by date

Next:From: Neil ConwayDate: 2006-01-12 05:28:40
Subject: Re: domain constraints and UNKNOWN params
Previous:From: Tom LaneDate: 2006-01-12 04:31:16
Subject: Re: domain constraints and UNKNOWN params

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group