[mythtv-users] Combined FE/BE using USB for all I/O?

Eric Sharkey eric at lisaneric.org
Sat Aug 16 15:27:59 UTC 2014


On Sat, Aug 16, 2014 at 9:59 AM, Simon Hobson <linux at thehobsons.co.uk> wrote:
> MythTV uses an internal circular buffer per record stream. The record process
> drops it's data in the buffer, and a separate process copies any data in the buffer to
> the file and does an fsync to ensure it gets written to disk.

Well, there's your problem.

The software I write professionally mostly does memory mapped I/O.
Files that are being written out are mmapped, written, then unmapped.
A separate thread syncs the unmapped regions (sync_file_range()) and
then does POSIX_FADV_DONTNEED to encourage these pages to be evicted
from the cache.  You can get very high output with streaming writes to
many files simultaneously this way and you won't lose data.  Circular
buffers are just asking for trouble.

Eric


More information about the mythtv-users mailing list