Re: Bug#605009: serious performance regression with ext4
On Tue, Nov 30, 2010 at 10:35:11AM +0100, Samuel Thibault wrote:
> Mike Hommey, le Tue 30 Nov 2010 10:07:55 +0100, a écrit :
> > On Mon, Nov 29, 2010 at 07:18:17AM +0100, Guillem Jover wrote:
> > > > What's going on here? sync_file_range() is a Linux specific system
> > > > call that has been around for a while. It allows program to control
> > > > when writeback happens in a very low-level fashion. The first set of
> > > > sync_file_range() system calls causes the system to start writing back
> > > > each file once it has finished being extracted. It doesn't actually
> > > > wait for the write to finish; it just starts the writeback.
> > >
> > > Hmm, ok so what about posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED)
> > > instead, skimming over the kernel source seems to indicate it might
> > > end up doing more or less the same thing but in a portable way?
> > On the other hand, there is no guarantee that other kernels do the same,
> Err, that's posix.
Being posix doesn't guarantee that posix_fadvise(fd, 0, 0,
POSIX_FADV_DONTNEED) is going to start write back, which is the desired
effect, but not what you may actually get, depending on the kernel.