[mythtv-commits] mythtv commit: r27285 by danielk

mythtv at cvs.mythtv.org mythtv at cvs.mythtv.org
Thu Nov 18 20:10:45 UTC 2010

      Author: danielk
        Date: 2010-11-18 20:10:45 +0000 (Thu, 18 Nov 2010)
New Revision: 27285
   Changeset: http://svn.mythtv.org/trac/changeset/27285


Fixes #5190. This tweaks file writing and reading a bit to better interact with modern VM and disk i/o schedulers.

To explain... First, we were sometimes using the wrong syscall to sync data to disk in the TFW. The sync_file_range call only syncs allocated blocks, which is often a no-op when appending to a file. It is useful for database type workloads, but what we really want is fdatasync(). Second, we were only using posix_fadvise to tell the OS what we wanted it to cache (some of the time), but we were not using it to hint to the OS what data we won't need in the near future. I've added the hinting for the seek to end optimization and I've added the calls to tell the OS what data we don't need it to cache. The later is important for Linux in particular as it will penalize the next application that requests memory for our sins in keeping unneeded disk buffers in memory after we're done with them.

This is based on Ingo Molnar's comments in the "The State of Linux IO Scheduling For the Desktop" story on slashdot.org 2010-10-24, I've run it for several weeks without any problems. It does not have as great a positive effect as I had hoped, but it does provide some benefit. This may provide more benefit on machines with less RAM.



More information about the mythtv-commits mailing list