Bug 10459
Summary: | budget_av: High CPU load due to CI slot polling | ||
---|---|---|---|
Product: | v4l-dvb | Reporter: | Robert Schedel (r.schedel) |
Component: | ttpci | Assignee: | ttpci (v4l-dvb_ttpci) |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | ||
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.24.4 | Subsystem: | |
Regression: | --- | Bisected commit-id: |
Description
Robert Schedel
2008-04-16 11:56:01 UTC
Preanalysis: 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 Call Trace: [<ffffffff80241da6>] __mod_timer+0xb6/0xd0 [<ffffffff804e52ff>] schedule_timeout+0x5f/0xd0 [<ffffffff80241890>] process_timeout+0x0/0x10 [<ffffffff80241dd6>] msleep+0x16/0x30 [<ffffffff880a0189>] :saa7146:saa7146_wait_for_debi_done+0x159/0x260 [<ffffffff880bba3a>] :budget_core:ttpci_budget_debiread+0x6a/0x140 [<ffffffff880d1cfb>] :budget_av:ciintf_poll_slot_status+0xbb/0x1c0 [<ffffffff880aa800>] :dvb_core:dvb_ca_en50221_thread+0x0/0xa10 [<ffffffff880a9339>] :dvb_core:dvb_ca_en50221_check_camstatus+0x59/0x100 [<ffffffff880aa8ba>] :dvb_core:dvb_ca_en50221_thread+0xba/0xa10 [<ffffffff8022f221>] update_curr+0x61/0xb0 [<ffffffff8022f221>] update_curr+0x61/0xb0 [<ffffffff802341e6>] dequeue_task_fair+0x46/0x80 [<ffffffff8022f79d>] __dequeue_entity+0x3d/0x50 [<ffffffff804e4a7e>] thread_return+0x3d/0x52f [<ffffffff80288da4>] filp_close+0x54/0x90 [<ffffffff880aa800>] :dvb_core:dvb_ca_en50221_thread+0x0/0xa10 [<ffffffff8024d48b>] kthread+0x4b/0x80 [<ffffffff8020ca48>] child_rip+0xa/0x12 [<ffffffff8024d440>] kthread+0x0/0x80 [<ffffffff8020ca3e>] child_rip+0x0/0x12 --------------------------------------------------- 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://www.mail-archive.com/linux-dvb@linuxtv.org/msg22094.html (similar report against older kernel, driver code has changed since) - http://www.mail-archive.com/linux-dvb@linuxtv.org/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: http://www.linuxtv.org/pipermail/linux-dvb/2008-April/025248.html Included in 2.6.26-rc3 -> CLOSED. |