首页 > 解决方案 > 如何调试此问题。chrt:未能设置 pid 14490 的策略:不允许操作

问题描述

chrt -p 14490
pid 14490's current scheduling policy: SCHED_OTHER
pid 14490's current scheduling priority: 0`

我正在尝试使用以下命令将此进程的调度优先级更改为 SCHED_RR 并遇到以下错误。

chrt -r -p 25 14490
chrt: failed to set pid 14490's policy: Operation not permitted

我该如何调试为什么会失败?

标签: linux

解决方案


您未能指定您的 Linux 版本... ...但这里有几个选项:

https://unix.stackexchange.com/questions/114643/chrt-failed-to-set-pid-xxxs-policy-on-one-machine-but-not-others

sysctl -w kernel.sched_rt_runtime_us=-1

https://lists.opensuse.org/opensuse-security/2011-04/msg00015.html

... 和 ...

https://www.linuxquestions.org/questions/slackware-14/chrt-from-shell-scripts-operation-not-permitted-4175590174/

我在虚拟化的 slackware 14.2 上进行了测试。没有错误。我从当前升级到 util-linux-2.28.2,然后我遇到了那个错误。

上游提交:https ://github.com/karelzak/util-lin...ec919bec94089f

将线程标记为已解决。

换句话说:

  • 你可以试试sysctl -w kernel.sched_rt_runtime_us=-1
  • 但是至少有两个报告的实例表明这是一个错误:在 slackware 和 util-linux 中。这两种情况的解决方案都是更新 Linux 版本。

推荐阅读