Re: Free WAL caches on switching segments

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)lab(dot)ntt(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Free WAL caches on switching segments
Date: 2005-08-30 07:38:53
Message-ID: 20050830162950.4A5E.ITAGAKI.TAKAHIRO@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane <tgl(at)sss(dot)pgh(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 ...

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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-08-30 18:58:30 Re: enable/disable trigger (Re: Fwd: [HACKERS] Open items)
Previous Message Tom Lane 2005-08-30 07:25:27 Re: Free WAL caches on switching segments