[mythtv-commits] Ticket #9150: RingBuffer/ThreadedFileWriter + fadvise

MythTV mythtv at cvs.mythtv.org
Thu Nov 18 20:13:47 UTC 2010


#9150: RingBuffer/ThreadedFileWriter + fadvise
------------------------------+---------------------------------------------
 Reporter:  danielk           |           Owner:  danielk   
     Type:  enhancement       |          Status:  closed    
 Priority:  minor             |       Milestone:  0.25      
Component:  MythTV - General  |         Version:  Trunk Head
 Severity:  medium            |      Resolution:  Fixed     
 Keywords:                    |   Ticket locked:  0         
------------------------------+---------------------------------------------
Changes (by danielk):

  * status:  accepted => closed
  * resolution:  => Fixed


Comment:

 (In [27285]) Fixes #9190. 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.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/9150#comment:4>
MythTV <http://www.mythtv.org/>
MythTV Media Center


More information about the mythtv-commits mailing list