[linux-dvb] High CPU load in "top" due to budget_av slot polling
r.schedel at yahoo.de
Mon Apr 7 11:29:01 CEST 2008
on 2.6.24 I run into a small issue with the budget_av driver:
Hardware: Athlon 64X2 3800+, Satelco Easywatch DVB-C (1894:002c), no CI/CAM
Software: Linux kernel 2.6.24 (gentoo-r4) 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.
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
> saa7146: saa7146_wait_for_debi_done_sleep(): saa7146 (0):
saa7146_wait_for_debi_done_sleep timed out while waiting for transfer
Increasing the 250ms did not avoid the timeout. And as I understood from
previous 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.
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.
Finally, my questions:
1. Did I understand this right, that the behaviour above is expected
when no CI is connected?
2. Are all budget_av cards unable to check CAM slot state via interrupt
for HW reasons (as budget_ci does)?
3. Would it be possible to substitute the current PSR DEBI_S polling
with an interrupt based solution via IER/ISR? (driver av7110 alreadys
seems to do this for its DEBI DMA)? Or was this not considered worthy,
due to the expected short waiting period and the tricky IER handling?
The code does not state further thoughts about this.
4. Are the high timeout periods in debi_done (50ms/250ms) in relation to
the 100ms poll timer intended? (I found the recent patch to this code in
the mailing list end of last year)
5. If we would be restricted to poll with high frequency: Why not at
least allow users without CI to disable polling for slots or change the
interval, e.g. via module options?
More information about the linux-dvb