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: > > > 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.
What is POSIX? What exactly is written in the standard? Please quote. Okay, here is the quote[1]: | POSIX_FADV_DONTNEED | Specifies that the application expects that it will not access the | specified data in the near future. sync_file_range is Linux-specific and documented to do exactly what we want[2]. posix_fadvise with POSIX_FADV_DONTNEED is not documented to do what we want but only does it as a side-effect (and may hurt others because it evicts anything of the cache). Bastian [1]: http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fadvise.html [2]: fs/sync.c -- "That unit is a woman." "A mass of conflicting impulses." -- Spock and Nomad, "The Changeling", stardate 3541.9 -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20101130102602.ga22...@wavehammer.waldi.eu.org