Mailinglist Archive: opensuse (1239 mails)

< Previous Next >
Re: [opensuse] Re: XFS and openSUSE 12.1
On Thu, Jun 13, 2013 at 10:12 AM, Roger Oberholtzer <roger@xxxxxx> wrote:
On Thu, 2013-06-13 at 10:04 -0400, Greg Freemyer wrote:
On Thu, Jun 13, 2013 at 3:41 AM, Carlos E. R.
<robin.listas@xxxxxxxxxxxxxx> wrote:

By the way, try not to use "fsync". It forces the kernel to write to
disk even if not convenient.


The fadvise call only trashes cache that has already been written to
disk. So you can call it as often as you want prior to the close, but
the last thing that is done needs to be:

fsync()
fadvise(0,len,DONTNEED)

Can the start,stop parameters be 0,0? Meaning all pages for this file?

close()

Greg

Roger,

I'm guessing you can read a man page as well as I can, but from the
posix_fadvise man page:

==
The advice applies to a (not necessarily existent) region starting at
offset and extending for len bytes (or until the end of the file if
len is 0) within the file referred to by fd.
==

So, yes 0,0 means trash all cache from the start of the file to the end.

fyi: This is a new call to me and I've never used it, so I have no
first hand feedback.

Greg
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
This Thread