sync_file_range() - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject sync_file_range()
Date
Msg-id 44963A36.4090606@calorieking.com
Whole thread Raw
Responses Re: sync_file_range()  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
List pgsql-hackers
http://lwn.net/Articles/178199/

Check out the article on sync_file_range():

----
long sync_file_range(int fd, loff_t offset, loff_t nbytes, int flags);

This call will synchronize a file's data to disk, starting at the given 
offset and proceeding for nbytes bytes (or to the end of the file if 
nbytes is zero). How the synchronization is done is controlled by flags:
    * SYNC_FILE_RANGE_WAIT_BEFORE blocks the calling process until any 
already in-progress writeout of pages (in the given range) completes.
    * SYNC_FILE_RANGE_WRITE starts writeout of any dirty pages in the 
given range which are not already under I/O.
    * SYNC_FILE_RANGE_WAIT_AFTER blocks the calling process until the 
newly-initiated writes complete.

An application which wants to initiate writeback of all dirty pages 
should provide the first two flags. Providing all three flags guarantees 
that those pages are actually on disk when the call returns.
----

Is that at all useful for PostgreSQL's purposes?

Chris




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: kill_prior_tuple for bitmap scan
Next
From: "Qingqing Zhou"
Date:
Subject: Re: kill_prior_tuple for bitmap scan