如何设置intel_idle.max_cstate = 0以禁用c状态? [英] How to set intel_idle.max_cstate=0 to disable c-states?

查看:1696
本文介绍了如何设置intel_idle.max_cstate = 0以禁用c状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在计算机上禁用c状态.

I would like to disable c-states on my computer.

我在BIOS上禁用了c-state,但是没有得到任何结果.但是,我找到了一个解释: 在具有英特尔处理器的系统上,大多数较新的Linux发行版都使用"intel_idle"驱动程序(可能编译到您的内核中,而不是单独的模块中)来使用C状态.该驱动程序利用各种CPU的知识来控制C状态,而无需来自系统固件(BIOS)的输入.此驱动程序将几乎忽略任何其他BIOS设置和内核参数.

I disabled c-state on BIOS but I don't obtain any result. However, I found an explanation : "Most newer Linux distributions, on systems with Intel processors, use the "intel_idle" driver (probably compiled into your kernel and not a separate module) to use C-states. This driver uses knowledge of the various CPUs to control C-states without input from system firmware (BIOS). This driver will mostly ignore any other BIOS setting and kernel parameters"

我找到了两种解决此问题的方法,但是我不知道如何申请:

I found two solutions to solve this problem but I don't know how to apply:

1)因此,如果要控制C状态,则应使用内核参数"intel_idle.max_cstate = 0"来禁用此驱动程序."

1) " so if you want control over C-states, you should use kernel parameter "intel_idle.max_cstate=0" to disable this driver."

我既不知道如何检查intel_idle.max_cstate的值,也不知道如何更改其值.

I don't know neither how I can check the value (of intel_idle.max_cstate ) and neither how I can change its value.

2)要动态控制C状态,请打开文件/dev/cpu_dma_latency并向其写入最大允许延迟.这将防止使用转换延迟高于指定值的C状态,只要/dev/cpu_dma_latency文件保持打开状态.将最大允许延迟写入0将使处理器保持在C0状态.

2) "To dynamically control C-states, open the file /dev/cpu_dma_latency and write the maximum allowable latency to it. This will prevent C-states with transition latencies higher than the specified value from being used, as long as the file /dev/cpu_dma_latency is kept open. Writing a maximum allowable latency of 0 will keep the processors in C0"

我无法读取文件cpu_dma_latency.

I can't read the file cpu_dma_latency.

感谢您的帮助.

计算机: 英特尔至强CPU E5-2620 侏儒2.28.2 Linux 2.6.32-358

Computer: Intel Xeon CPU E5-2620 Gnome 2.28.2 Linux 2.6.32-358

推荐答案

要在启动时更改值,您可以修改GRUB配置或即时编辑它-修改方法因分布而异. 是Ubuntu文档,用于一次或永久更改内核参数.对于RHEL派生的发行版,我没有看到那么清晰的文档,但是您直接修改了/boot/grub/grub.conf以便在每个可启动节的内核"行中包含该参数.

To alter the value at boot time, you can modify the GRUB configuration or edit it on the fly -- the method to modify that varies by distribution. This is the Ubuntu documentation to change kernel parameters either for a single boot, or permanently. For a RHEL-derived distribution, I don't see docs that are quite as clear, but you directly modify /boot/grub/grub.conf to include the parameter on the "kernel" lines for each bootable stanza.

对于问题的第二部分,许多设备文件是只读或只写的.您可以使用像这样的小型perl脚本(未经测试,不是很干净,但是应该可以工作)来保持文件打开:

For the second part of the question, many device files are read-only or write-only. You could use a small perl script like this (untested and not very clean, but should work) to keep the file open:

#!/usr/bin/perl

use FileHandle;
my $fd = open (">/dev/cpu_dma_latency");
print $fd "0";
print "Press CTRL-C to end.\n";

while (1) {
    sleep 5;
}

Redhat在KB文章此处中有一个C代码段,以及有关以下内容的更多说明参数.

Redhat has a C snippet in a KB article here as well and more description of the parameter.

这篇关于如何设置intel_idle.max_cstate = 0以禁用c状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆