Kernel Bug Tracker – Bug 10459
budget_av: High CPU load due to CI slot polling
Last modified: 2008-05-23 13:16:14 UTC
Failing kernel version: 126.96.36.199
Distribution: Gentoo (reproducable with gentoo kernel as well as vanilla kernel 188.8.131.52!)
Hardware Environment: Athlon 64X2 3800+, Satelco Easywatch DVB-C (1894:002c), no CI/CAM
Software Environment: Linux kernel 184.108.40.206 SMP x86_64, budget_av module
After the budget_av driver module is loaded (even without any DVB application), the CPU load average in 'top' rises to ~1, but in top no active tasks are found. After unloading the driver, the load decreases again to ~0.
Steps to reproduce:
- Precondition: budget_av card (e.g. Satelco EasyWatch DVB-C) without CI inserted in PCI slot
- modprobe budget_av
- Watch CPU load in top
Please note: The high CPU load is not only a statistical issue due to the kernel accounting. It would put at least some unnecessary stress on PCI and CPU and e.g. also has the effect that cron tasks with idle guard condition would not start, so on midterm this should be fixed.
1) lspci output:
00:09.0 Multimedia controller: Philips Semiconductors SAA7146 (rev 01)
Subsystem: KNC One Unknown device 002c
Flags: bus master, medium devsel, latency 64, IRQ 16
Memory at fb500000 (32-bit, non-prefetchable) [size=512]
Kernel driver in use: budget_av
Kernel modules: budget-av
2) uptime output when issue occurs (load can differ between ~0,7-1):
10:57:32 up 1:14, 1 user, load average: 0.75, 0.45, 0.19
3) kernel information:
Linux 220.127.116.11 #1 SMP Fri Apr 11 10:07:01 CEST 2008 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ AuthenticAMD GNU/Linux
4) Syslog output when loading budget_av module:
saa7146: register extension 'budget_av'.
ACPI: PCI Interrupt 0000:00:09.0[A] -> GSI 16 (level, low) -> IRQ 16
saa7146: found saa7146 @ mem ffffc2000001e000 (revision 1, irq 16) (0x1894,0x002c).
saa7146 (0): dma buffer size 192512
DVB: registering new adapter (Satelco EasyWatch DVB-C MK3)
adapter failed MAC signature check
encoded MAC from EEPROM was ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff
KNC1-0: MAC addr = 00:09:[...]
DVB: registering frontend 0 (Philips TDA10023 DVB-C)...
budget-av: ci interface initialised.
5) Full lsmod output after budget_av has been loaded:
Module Size Used by
tda10023 6532 1
budget_av 20736 0
saa7146_vv 49856 1 budget_av
videobuf_dma_sg 12676 1 saa7146_vv
videobuf_core 17348 2 saa7146_vv,videobuf_dma_sg
firmware_class 8768 1 budget_av
budget_core 10436 1 budget_av
dvb_core 83436 2 budget_av,budget_core
saa7146 16904 3 budget_av,saa7146_vv,budget_core
ttpci_eeprom 2496 1 budget_core
ip6table_filter 2752 1
xt_state 2560 2
powernow_k8 13600 1
Please report when additional information is required.
Displaying the blocked tasks during high load with Alt-SysRq-W shows that the kdvb-ca kernel thread seems to be accounted as blocked when it polls for the CI slot status:
SysRq : Show Blocked State
task PC stack pid father
kdvb-ca-0:0 D 0000000100d78984 0 2046 2
ffff81007ee73c70 0000000000000046 0000000000000000 0000000000000008
0000000000000800 0000000000000000 0000000000000286 ffff81007bebe080
ffff81007f8d47e0 ffff81007ee73c80 ffff81007ed91a00 0000000100d78984
Enabling debug traces shows that polling for the PSR in function 'saa7146_wait_for_debi_done_sleep' constantly times out after 250x1ms sleeps:
> saa7146: saa7146_wait_for_debi_done_sleep(): saa7146 (0):
saa7146_wait_for_debi_done_sleep timed out while waiting for transfer completion
Increasing the 250ms did not avoid the timeout. And as I understood from previous v4l-dvb list mails, this timeout is normal when no CI/CAM is connected to the DEBI. However, for me the high frequency polling does not make sense if someone does not plan to plug in a CI/CAM.
When commenting out two lines in 'dvb_ca_en50221_thread_update_delay' to increase the polling timer for slotstate NONE from 100ms (!) to 60s, the CPU load went down to 0. So this is some kind of workaround for me.
Ticket has been created for tracking.
Previous mail threads with some technical discussion:
- http://www.linuxtv.org/pipermail/linux-dvb/2008-April/025248.html (current status as described above for kernel 2.6.24, some technical discussion, no final solution yet)
- http://firstname.lastname@example.org/msg22094.html (similar report against older kernel, driver code has changed since)
- http://email@example.com/msg25556.html (similar report against older kernel, driver code has changed since)
Bugfix has been included in official kernel 2.6.26-rc3:
> V4L/DVB (7830): dvb_ca_en50221: Fix High CPU load in 'top' due to budget_av slot polling
Therefore, for me this bug is resolved now.
Bugfix was already verified successfully by me, see the following mail thread for details:
Included in 2.6.26-rc3 -> CLOSED.