Projects - Myth Patches - O_STREAMING

When you read and write files under Linux, the kernel caches the data in it's pagecache. The cached data consists of both readahead data (i.e. the kernel predicts that you will soon need some data infront of the file pointer, so preemptively reads it into memory for you) and recently accessed data. In the case of large data streams (such as video), the caching of recently accessed data is not that useful since you will (almost) never be going back and re-reading old data. Infact, keeping this data in the cache is harmful because it means other data in the cache will be expired to make room for the streamed data, so when the data is needed it must be fetched from the disk again.

By instructing the kernel not to keep old streaming data in the pagecache, the useful data is not expired, which makes the frontend much more responsive just after finishing watching TV. This patch sets the O_STREAMING flag when the ring buffer is opened. You will also need the O_STREAMING kernel patch.

This patch is obsolete as of MythTV 0.14. It has now been included in the official MythTV release. However, you need to make sure that when you're compiling you have "#define O_STREAMING 04000000" in your /usr/include/bits/fcntl.h file to enable this feature.


Contact Me
Site last updated: 26th June, 2013