perf: interrupt took too long

Perf 问题

最近Linux 内核总是报一下错误信息,所以抽出点时间找了点资料了解了下:

[ 6216.961770] perf: interrupt took too long (2502 > 2500), lowering kernel.perf_event_max_sample_rate to 79000

发现在红帽的Bugzilla上已经有人提出过这个bug了,瞬间感觉轻松了不少,通读之后可以确定是Linux 内核perf 功能在打开的状态可以通过调节参数来修改这个问题。

最后找到一个关于这个bug相关的patch, 通过内核的注释可以看到一些内容,这些参数是在调试的时候比较有用的。

这个文件有详细的说明 : Documentation/sysctl/kernel.txt

+perf_cpu_time_max_percent:
+
+Hints to the kernel how much CPU time it should be allowed to
+use to handle perf sampling events.  If the perf subsystem
+is informed that its samples are exceeding this limit, it
+will drop its sampling frequency to attempt to reduce its CPU
+usage.
+
+Some perf sampling happens in NMIs.  If these samples
+unexpectedly take too long to execute, the NMIs can become
+stacked up next to each other so much that nothing else is
+allowed to execute.
+
+0: disable the mechanism.  Do not monitor or correct perf's
+   sampling rate no matter how CPU time it takes.
+
+1-100: attempt to throttle perf's sample rate to this
+   percentage of CPU.  Note: the kernel calculates an
+   "expected" length of each sample event.  100 here means
+   100% of that expected length.  Even if this is set to
+   100, you may still see sample throttling if this
+   length is exceeded.  Set to 0 if you truly do not care
+   how much CPU is consumed.
+
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值