[mythtv-commits] Ticket #9458: [patch] posix_fadvice usage

MythTV noreply at mythtv.org
Fri Jan 7 17:17:07 UTC 2011


#9458: [patch] posix_fadvice usage
----------------------------------------+----------------------------------
 Reporter:  jiri.fojtasek@…             |           Type:  Patch - Bug Fix
   Status:  new                         |       Priority:  minor
Milestone:  0.25                        |      Component:  MythTV - General
  Version:  Trunk Head                  |       Severity:  medium
 Keywords:                              |  Ticket locked:  0
----------------------------------------+----------------------------------
 Goal of this patch is fix issues introduced by latest changes to page
 cache management and to have page cache under our control much as posible.

 threadedfilewriter fixes:
 - We need toss only writen portion of the data from the pagecache, since
 the same file may be used by ringbuffer (live tv play). This bug marked
 any posix_fadvice optimisation changes to the ringuffer useless because it
 doing only unnecessarily disk io (see ringbuffer fixes).
 - Changed order of syncer and writer thread termination in order to
 correctly toss remaining portion of unused page cache.

 ringbuffer fixes:
 - POSIX_FADV_WILLNEED called after a seek with 1MB size is useless since
 read() may be called immediately, so this may cause only unnecessarily
 disk io. Linux OS have already its own readahead algorithm so lets tweak
 it by blockdev --setra
 - Marking whole portion of the file in pagecache as unused is useless
 since more frontends may read the file at same time and this will negate
 OS readahead effeciency (another unnecessarily disk io)
 - In main readahead loop mark as unused only portion of the pagecache we
 used in last read (more frontends may read the same file).
 - When the file is closed mark whole pagecache unused, since we do not
 have explicit control to what is filled by OS readahead. This may flush
 pagecace for other readers but this not happen often so this payoff is
 acceptable.

 Jiri

-- 
Ticket URL: <http://code.mythtv.org/trac/ticket/9458>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center


More information about the mythtv-commits mailing list