How to read and interpret /dev/cpu_dma_latency?

 

How to read and interpret /dev/cpu_dma_latency?

 SOLUTION 已验证 - 已更新 2018年五月29日19:35 - 

English 

环境

Red Hat Enterprise Linux 7

问题

  • Reading /dev/cpu_dma_latency from userspace / user mode is not clarified in kernel sources in 'Documentation/power/pm_qos_interface.txt'

  • reading /dev/cpu_dma_latency prints gibberish

Raw

# cat /dev/cpu_dma_latency
�5w

决议

Reading /dev/cpu_dma_latency returns the raw value for the cpu QoS latency target in microseconds. Since this value is "raw" (not encoded as text) you can read it with something like hexdump. By default on Red Hat Enterprise Linux 7 it is set to 2000 seconds.

Raw

# hexdump -C `/dev/cpu_dma_latency`
00000000  00 94 35 77                                       |..5w|
00000004

# echo $(( 0x77359400 ))
2000000000

This is set in the kernel source code in 'include/linux/pm_qos.h'

Raw

#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE    (2000 * USEC_PER_SEC)

When some application such as for example 'tuned' with profile 'latency-performance' is running, then you will see a different value such as:

Raw

  # hexdump -C `/dev/cpu_dma_latency`
  00000000  01 00 00 00                                       |....|
  00000004

The 'latency-performance' profile of tuned uses "force_latency=1" which writes '1' to /dev/cpu_dma_latency. Zero would completely disable some power management frequency and voltage scaling depending on cpu hardware capabilities. A value of "1" is the lowest possible latency target before completely disabling some power management functionality.

For more details regarding latency requirements and power management please refer to:

Are hardware power management features causing latency spikes in my application?

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值