[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bacula-devel] Correct usage of posix_fadvise in SD?

On Monday 29 September 2008 14:13:16 Brice Figureau wrote:
> Hi,
> I was looking to the 2.4.2 SD spooling code lately (this was part of
> understanding why despooling performances were not that good on my
> hardware), when I noticed the following usage of posix_fadvise while
> sequentially reading the spool file (despool_data):
>    posix_fadvise(rdcr->spool_fd, 0, 0, POSIX_FADV_WILLNEED);
> #endif
> I don't understand why we're telling the kernel to page cache the spool
> file we're reading since we won't reuse those data.
> Moreover, there is no "DONTNEED" call after despool_data to let the
> kernel know it can trash what we read.
> I thought that something along the line of this in despool_data:
>    posix_fadvise(rdcr->spool_fd, 0, 0, POSIX_FADV_SEQUENTIAL);
> #endif
> #if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_NOREUSE)
>    posix_fadvise(rdcr->spool_fd, 0, 0, POSIX_FADV_NOREUSE);
> #endif
> And a few POSIX_FADV_DONTNEED after each block read with the correct
> offset and length to tell the pagecache we don't need this part anymore.
> Does it make sense?
> Or did I miss something?

Why don't you run some tests measuring the performance of your proposed 
changes versus what is there now.  That would give a much more definitive 
answer than I can ...



This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Bacula-devel mailing list

This mailing list archive is a service of Copilot Consulting.