[mythtv-users] Mythfrontend idle cpu consumption help

jansenj jansenj+myth at gmail.com
Mon Nov 16 22:28:26 UTC 2009


using "strace -T -p<mythfrontend.real PID>"

I'm seeling the poll system call take the longest:

poll([{fd=4, events=POLLIN}, {fd=9, events=POLLIN}, {fd=8, events=POLLIN},
{fd=12, events=POLLIN}, {fd=29, events=POLLIN}], 5, 13) = 0 (Timeout)
<0.013084>

using "strace -c -p<mythfrontend.real PID>" for a few seconds.
I see that the poll system call is eating most of the time. And as you can
see, the clock_gettime is very insignificant compared to the time spent in
the poll routine.

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 98.52    0.080000          14      5564           poll
  0.77    0.000622           0     11136           clock_gettime
  0.72    0.000582           0     11132     11131 read
  0.00    0.000000           0         1           restart_syscall

I also see when top is running that when I run strace -c, the strace
utilization + mythfrontend utilization ~= 14%. That tells me that the
implementation of the polling routine has a "busy wait" timeout in it.
Something that consumes the cpu while it waits, but does not take any longer
to wait if the context is switched out to another thread in the meantime. If
we really need to poll at that rate, is there a way to reduce the timeout
for the poll system call?

Personally, I would think you might want large timeout for low rate polling,
but polling at 70Hz or something, I would think you wouldn't even need a
timeout.

So, is this poll routine the one in question that would be in the Qt domain,
not the myth domain?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20091116/5c7b16b7/attachment.htm>


More information about the mythtv-users mailing list