[mythtv-commits] Ticket #11230: mythlogserver high cpu usage
MythTV
noreply at mythtv.org
Sun Mar 10 12:20:05 UTC 2013
#11230: mythlogserver high cpu usage
------------------------------------+-------------------------
Reporter: cleanrock@… | Owner: beirdo
Type: Bug Report - General | Status: new
Priority: minor | Milestone: unknown
Component: MythTV - Mythlogserver | Version: 0.26
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------------+-------------------------
Comment (by Andrew Armstrong <androidarmstrong@…>):
I've had this problem ever since upgrading from MythTV 0.25 to 0.26 on my
ARCH Linux system.
mythlogserver processes seem to be looping in the nvidia display driver,
so to experience it you must have an nvidia graphics card.
An easy way to reproduce the problem (for me) is to start a gdb debug
session with the original mythlogserver (non-looping) process:
{{{
gdb mythlogserver nnnn
}}}
...where nnnn is the PID of the mythlogserver process that is not using a
lot of CPU.
Almost immediately, more mythlogserver instances will be started (every 30
seconds or so) and will eat CPU. Exit from gdb. No new instances should
start. Now start a gdb session with one of the looping mythlogserver
instances and issue a backtrace command:
{{{
(gdb) bt
#0 0x00007fc23399bd18 in _nv012tls () from /usr/lib/libnvidia-
tls.so.313.26
#1 0x00007fc237732be8 in ?? () from /usr/lib/libGL.so.1
#2 0x00007fc23770e06a in ?? () from /usr/lib/libGL.so.1
#3 0x00007fc243840fff in _dl_fini () from /lib64/ld-linux-x86-64.so.2
#4 0x00007fc2412c2e51 in __run_exit_handlers () from /usr/lib/libc.so.6
#5 0x00007fc2412c2ed5 in exit () from /usr/lib/libc.so.6
#6 0x00007fc2412aca1c in __libc_start_main () from /usr/lib/libc.so.6
#7 0x0000000000401e49 in ?? ()
}}}
...this tells me that the loop is in /usr/lib/libnvidia-tls.
Dissassembling shows the looping code:
{{{
(gdb) disassemble 0x00007fc23399bd18
Dump of assembler code for function _nv012tls:
0x00007fc23399bcf0 <+0>: mov 0x201ab1(%rip),%rax #
0x7fc233b9d7a8
0x00007fc23399bcf7 <+7>: push %rbx
0x00007fc23399bcf8 <+8>: mov 0x10(%rax),%rax
0x00007fc23399bcfc <+12>: mov %fs:(%rax),%rbx
0x00007fc23399bd00 <+16>: callq 0x7fc23399ba30 <_nv008tls>
0x00007fc23399bd05 <+21>: test %rax,%rax
0x00007fc23399bd08 <+24>: mov %rax,%rdx
0x00007fc23399bd0b <+27>: je 0x7fc23399bd24 <_nv012tls+52>
0x00007fc23399bd0d <+29>: nopl (%rax)
0x00007fc23399bd10 <+32>: cmp %rbx,%rdx
0x00007fc23399bd13 <+35>: je 0x7fc23399bd1c <_nv012tls+44>
0x00007fc23399bd15 <+37>: mov 0x8(%rdx),%eax
=> 0x00007fc23399bd18 <+40>: test %eax,%eax
0x00007fc23399bd1a <+42>: jne 0x7fc23399bd15 <_nv012tls+37>
0x00007fc23399bd1c <+44>: mov (%rdx),%rdx
0x00007fc23399bd1f <+47>: test %rdx,%rdx
0x00007fc23399bd22 <+50>: jne 0x7fc23399bd10 <_nv012tls+32>
0x00007fc23399bd24 <+52>: pop %rbx
0x00007fc23399bd25 <+53>: retq
End of assembler dump.
}}}
FWIW I suspect that the loop is between the jne and mov instructions:
{{{
0x00007fc23399bd15 <+37>: mov 0x8(%rdx),%eax
=> 0x00007fc23399bd18 <+40>: test %eax,%eax
0x00007fc23399bd1a <+42>: jne 0x7fc23399bd15 <_nv012tls+37>
}}}
Google shows that in an earlier version of the nvidia driver the loop was
even tighter (simply a jump to the same jump instruction).
So my guess is that the immediate cause of the high CPU utilisation is an
nvidia driver error. Somehow, the nvidia driver is being called as an exit
handler when mythlogserver tries to exit (because an instance is already
running perhaps). But I do wonder why a graphics card driver is being
invoked for a program such as mythlogserver which runs as a daemon.
The nvidia driver versions that I have seen with this problem since I
moved to MythTV 0.26 are:
{{{
[2012-11-21 18:37] upgraded nvidia (302.17-4 -> 310.19-2)
[2013-03-03 19:10] upgraded nvidia (310.19-2 -> 313.18-3)
[2013-03-07 00:19] upgraded nvidia (313.18-3 -> 313.26-1)
}}}
...302.17-4 was with MythTV 0.25, so it is unknown whether that exhibited
the problem as there was no mythlogserver program in 0.25.
My nvidia card details are:
{{{
[myth at myth ~]$ nvidia-smi
Sun Mar 10 22:58:09 2013
+------------------------------------------------------+
| NVIDIA-SMI 4.313.26 Driver Version: 313.26 |
|-------------------------------+----------------------+----------------------+
| GPU Name | Bus-Id Disp. | Volatile Uncorr.
ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute
M. |
|===============================+======================+======================|
| 0 GeForce GT 240 | 0000:01:00.0 N/A |
N/A |
| 10% 40C N/A N/A / N/A | 3% 30MB / 1023MB | N/A
Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Compute processes: GPU
Memory |
| GPU PID Process name Usage
|
|=============================================================================|
| 0 Not Supported
|
+-----------------------------------------------------------------------------+
}}}
--
Ticket URL: <http://code.mythtv.org/trac/ticket/11230#comment:7>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list