CPU consumption due to mdelay(5) in pxp_buf_queue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

CPU consumption due to mdelay(5) in pxp_buf_queue

612 次查看
morenodissegna
Contributor I

Hi everyone,

I'm working on an i.MX6UltraLite processor.

I noticed a call to mdelay(5) in the pxp_buf_queue function in mxc_pxp_v4l2.c.

This function is called once per every frame that is submitted to video4linux.

This means that if I play a video @ 25fps, about 12% CPU time is spent busy waiting.

This is confirmed by running gstreamer with the perf tool.

Is this delay really needed? What is its purpose?

标签 (3)
2 回复数

532 次查看
b36401
NXP Employee
NXP Employee

Actually if the process is in sleep ("S") state it does not cunsume CPU power.

0 项奖励

532 次查看
morenodissegna
Contributor I

CPU is consumed because mdelay(5) causes the cpu to busy wait for 5 ms.

Please check out the kernel docs https://www.kernel.org/doc/Documentation/timers/timers-howto.txt :

These functions use the jiffie estimation of clock speed and will busy wait for enough loop cycles to achieve the desired delay
0 项奖励