Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Recordings menu sluggish - *the* solution.



Dr. Werner Fink wrote:
On Fri, Oct 03, 2003 at 03:48:24PM +0200, Carsten Koch wrote:

Hi,

we have discussed this subject here before.
I believe we consent that the main reason for the big delays
when opening the recordings menu is the fact that vdr reads
and writes huge amounts of data from/to the nnn.vdr files,
the kernel tries to cache these, thus moving much more useful
stuff (like cached directory entries and cached small files)
out of the memory cache.
It usually makes no sense at all to cache the nnn.vdr files,
as they normally are read/written only once.

I recently found out that kernels > 2.4.9 seem to have exactly
the solution we were looking for.

From "man 2 open":

      O_DIRECT
             Try to minimize cache effects of  the  I/O  to  and
             from  this file.  In general this will degrade per­
             formance, but it is useful in  special  situations,
             such  as  when  applications  do their own caching.
             File  I/O  is  done  directly  to/from  user  space
             buffers.  The I/O is synchronous, i.e., at the com­
             pletion of the read(2)  or  write(2)  system  call,
             data   is  guaranteed  to  have  been  transferred.
             Transfer sizes, and the alignment  of  user  buffer
             and  file offset must all be multiples of the logi­
             cal block size of the file system.
             This flag is supported on  a  number  of  Unix-like
             systems;  support  was  added under Linux in kernel
             version 2.4.10.
             A semantically similar interface for block  devices
             is described in raw(8).


I guess a patch that uses this should be trivial.

If you're using O_DIRECT you've to provide the thread which writes
out the stuff in background. In other words: you need a ringbuffer
an own thread and the interface for your application.

If you not do this the application has to wait (e.g. a big DB using
O_DIRECT for secure data transfer) upto the point where teh data has be put onto the physical sector of your disk ;)
Isnt there code in vdr already that does this?

Carsten.




I have not tried it yet.
Is there anything obvious that speaks against this being a nice
solution fo our problem?


    Werner



--
   ___________________________________________________________
  (                                                           )
  | Carsten Koch                  Phone: +49-4286-920001      |
  | ICEM Technologies GmbH          Fax: +49-4286-1608        |
  | Sotheler Mühlenweg 15        mailto:Carsten.Koch@icem.com |
  | 27404 Elsdorf-Hatzte, Germany  http://www.icem.com        |
  (___________________________________________________________)



--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index