Re: fix use of posix_fadvise in xlog.c

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: fix use of posix_fadvise in xlog.c
Дата
Msg-id 4C108544.5060808@enterprisedb.com
обсуждение исходный текст
Ответ на fix use of posix_fadvise in xlog.c  (Mark Wong <markwkm@gmail.com>)
Ответы Re: fix use of posix_fadvise in xlog.c  (Mark Wong <markwkm@gmail.com>)
Список pgsql-hackers
On 10/06/10 06:47, Mark Wong wrote:
> I wanted to propose a fix for to xlog.c regarding the use of
> posix_fadvise() for 9.1 (unless someone feels it's ok for 9.0).
> Currently posix_fadvise() is used right before a log file is closed so
> it's effectively not doing anything, when posix_fadvise is to be
> called.  This patch moves the posix_fadvise() call into 3 other
> locations within XLogFileInit() where a file handle is returned.  The
> first case is where an existing open file handle is returned.  The
> next case is when a file is to be zeroed out.  The third case is
> returning a file handle, which may be the file that was just zeroed
> out.

I don't think POSIX_FADV_DONTNEED does what you think it does. It tells 
the kernel that "you don't need to keep these pages in the cache 
anymore, I won't be accessing them anymore". If you call it when you 
open the file, before reading/writing, there is nothing in the cache and 
the call will do nothing.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: Streaming Replication: Checkpoint_segment and wal_keep_segments on standby
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: InvalidXLogRecPtr in docs