[mythtv-users] Use of fsync

Rich Freeman r-mythtv at thefreemanclan.net
Tue Oct 22 16:34:28 UTC 2013


On Tue, Oct 22, 2013 at 12:31 PM, Eric Sharkey <eric at lisaneric.org> wrote:
> On Tue, Oct 22, 2013 at 12:10 PM, Eric Sharkey <eric at lisaneric.org> wrote:
>>
>> Except that fdatasync is more than just a suggestion.  If you wanted
>> to use a suggestion, wouldn't posix_fadvise(..., POSIX_FADV_DONTNEED)
>> be gentler?
>
> Never mind.  This doesn't work on pages that aren't already on disk.
>

Yup.  Still, not an entirely bad idea since the writes are frequent
and it would apply to the last batch of writes.  However, before
calling this the writing thread should probably determine if some
other thread is doing reads (unless the kernel is smart enough to
detect this and ignore the fadvise).  Watching Live TV seems like a
big case where data that is written is also likely to be read.

Rich


More information about the mythtv-users mailing list