Skip to content
Browse files

Make RingBuffer::WriterFlush() only flush data not sync it.

The reason we do syncs of the data is so that Linux doesn't build up too
many bufferred writes and freeze up the system later on writing many
GB to disk at once. However the amount of data typically flushed in
this call is not going to greatly increase the amount of data that will
need to be handled on the next fsync and this sync is causing
DTVRecorder::SetNextRecording() to take several seconds, hence
delaying TVRec::SwitchRecordingRingBuffer() and TVRec::StartRecording().
Since TVRec::StartRecording() blocks the scheduler this can mean
recording on other recorders is delayed by several seconds for
each other recorder starting a recording at the same time.
  • Loading branch information...
1 parent c473c64 commit 2b74a688c41882e373471d54c261642dce05d2c3 @daniel-kristjansson daniel-kristjansson committed
Showing with 1 addition and 5 deletions.
  1. +1 −5 mythtv/libs/libmythtv/ringbuffer.cpp
View
6 mythtv/libs/libmythtv/ringbuffer.cpp
@@ -1522,17 +1522,13 @@ long long RingBuffer::WriterSeek(long long pos, int whence, bool has_lock)
}
/** \fn RingBuffer::WriterFlush(void)
- * \brief Calls ThreadedFileWriter::Flush(void) and
- * ThreadedFileWriter::Sync(void).
+ * \brief Calls ThreadedFileWriter::Flush(void)
*/
void RingBuffer::WriterFlush(void)
{
rwlock.lockForRead();
if (tfw)
- {
tfw->Flush();
- tfw->Sync();
- }
rwlock.unlock();
}

0 comments on commit 2b74a68

Please sign in to comment.
Something went wrong with that request. Please try again.