Mailing List archive

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

[vdr] Re: SetEvents using too much CPU?



Jon Burgess wrote:
> 
> I have been running vdr-1.3.12 for a while and was noticed that my
> keyboard and mouse seemed to freeze for about 1 second every 5 seconds.
> I tracked this behaviour down to the CPU usage by main vdr thread.
> 
> Since the main VDR thread runs with realtime priority, it blocks all
> other non-realtime tasks whenever it wants to use the CPU. After some
> digging into the code I found that it was the SetEvents code that is
> running every 5 seconds and that on my machine this was monopolising the
> CPU for almost 1 second. This starves X, xmms etc of CPU and causes my
> system to stutter badly (although the VDR recording and playback is OK).
> 
> I have attached two patches. One patch adds some debugging to printout
> some debug about how much CPU the SetEvents code is taking. On my
> machine a typical event scan takes ~0.8 seconds, with a maximum of 1.09
> seconds (which is about a ~20% CPU load). This is on a machine with an
> Athlon XP 2000 (underclocked to around 1500), so a lower end machine may
> really struggle.
> 
> Is it unusual for the SetEvents code to sonsume so much CPU time?
> 
> The second patch is a trivial one that increases the scan interval from
> 5 to 60 seconds. I have been running this on my machine for a while and
> have not noticed any detrimental effects, but YMMV.
> 
> I don't expect that either patch will get applied to VDR as-is. They are
> just meant to highlight the problem and will hopefully prompt some
> further discussion.

I am currently in the process of ironing out some bottlenecks in the
VDR buffer handling, and while doing so will also dig into this matter.
I'll most likely make it so that the actual event/timer assignment
will only be done if an event is actually modified.

Klaus




Home | Main Index | Thread Index