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

From ITAGAKI Takahiro
Subject Re: Free WAL caches on switching segments
Date
Msg-id 20050830162950.4A5E.ITAGAKI.TAKAHIRO@lab.ntt.co.jp
Whole thread Raw
In response to Re: Free WAL caches on switching segments  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Free WAL caches on switching segments
List pgsql-patches
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


---
ITAGAKI Takahiro
NTT Cyber Space Laboratories



pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Free WAL caches on switching segments
Next
From: Bruce Momjian
Date:
Subject: Re: enable/disable trigger (Re: Fwd: [HACKERS] Open items)