[mythtv] [mythtv-commits] Ticket #3757: Reduce polling in mythwelcome

Doug Larrick doug at parkercat.org
Wed Aug 1 11:59:55 UTC 2007


>  First of all let me say I'm all for anything that saves power... and money
>  :-). I wrote MythWelcome and MythShutdown to make it easier and more user
>  friendly for those people who were concerned so they could set Myth to
>  shutdown when it was idle and that is of cause the best way to save power.

We thank you for this.  Works great!

>  I'm not convinced there is anything that needs to be fixed? On my system
>  MythWelcome is using virtually no cpu (less than 0.1%) and my Athlon X2
>  seems to stay running at it's lowest speed supported while MythWelcome is
>  running but that is based on average load I believe and it looks like
>  powertop produces much more fine grained analyse of things.

Powertop is using instrumentation in the kernel to measure what
processes are being woken by event timers.  On recent-enough kernels,
with tickless timers implemented, most laptop processors and some
desktop processors can enter deeper "C" sleep states the longer they're
idle.  Each lower "C" state corresponds to a significant drop in power.
 Now, most desktop systems can't do this trick, and I imagine
mythwelcome is running mostly on desktop systems, but I think this will
become more prevalent in all systems in future, so it's worth fixing.

>  Also there is nothing being polled in MythWelcome as such. There are 3
>  timers that update things. One fires every 30 seconds, one every 15
>  seconds and one every second. I've no idea how Qt implements these timers
>  or if it could be causing the polling you are seeing. Apart from that
>  MythWelcome doesn't actually do a great deal.

According to Powertop, on my system mythwelcome is being woken 180
times/sec.  My first step was to look at the code, and I see exactly
what you said... three timers at 30, 15, and 1 second intervals, plus a
couple of 1/2 second one-shot, event-driven timers.

Note that mythbackend itself is being woken ~100 times/sec, and
mythfrontend ~180 times/sec, which also seem excessive.  So I'm thinking
the problem is not actually in mythwelcome itself.  OpenGL vs Qt painter
does not make a difference.

My next step (tonight) is to look at libmyth to see what timers I can
find.  Certainly in the the case of mythwelcome, there's probably
infrastructure in use here that doesn't need to happen.

>  I don't have an Intel cpu so cannot verify your results and have no way to
>  test things to see if it improves anything. If you can compile your own
>  stuff and want to try a few things out let me know and maybe we can work
>  together.

I believe Powertop will run on AMD processors, if you have a recent
enough kernel with the right options set.  But don't take my word on that.

-Doug

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20070801/c2478966/attachment.pgp 


More information about the mythtv-dev mailing list