Re: Free WAL caches on switching segments - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Free WAL caches on switching segments
Date
Msg-id 200509231756.j8NHu9U13411@candle.pha.pa.us
Whole thread Raw
In response to Re: Free WAL caches on switching segments  (ITAGAKI Takahiro <itagaki.takahiro@lab.ntt.co.jp>)
Responses Re: Free WAL caches on switching segments
List pgsql-patches
ITAGAKI Takahiro wrote:
> Tom Lane <tgl@sss.pgh.pa.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 ...
>
>
> Do you mean simply following code? or more pretty way?
>
> #ifdef POSIX_FADV_DONTNEED
>     posix_fadvise(openLogFile, 0, 0, POSIX_FADV_DONTNEED);
> #endif

Yes, but we probably have to have a configure test to see if
posix_fadvise exists too.  I will keep this for 8.2.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: Multiple -t options for pg_dump
Next
From: Bruce Momjian
Date:
Subject: Re: be-secure.c patch