User Tools

Site Tools


realtime:documentation:howto:debugging:no-cpu-idle

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
realtime:documentation:howto:debugging:no-cpu-idle [2018/08/27 09:39]
ebugden [max_cstate parameters] Clarify phrasing
realtime:documentation:howto:debugging:no-cpu-idle [2018/08/27 09:56] (current)
ebugden Make kernel parameter changing method explanation more general
Line 60: Line 60:
 One common motivation for wanting to prevent CPU idling is avoiding gaps in kernel function traces that can be mistaken for unusual firmware or hardware caused latencies. The max_cstate parameters //cannot be used to prevent CPU idling//, but they can be used to prevent gaps in function traces. One common motivation for wanting to prevent CPU idling is avoiding gaps in kernel function traces that can be mistaken for unusual firmware or hardware caused latencies. The max_cstate parameters //cannot be used to prevent CPU idling//, but they can be used to prevent gaps in function traces.
  
-A max_cstate kernel parameter can be used to limit the maximum C-State. Limiting the maximum C-State to 1 will prevent having gaps in full function traces. Briefly, C-States are different power saving idle states. C-States 1 and up are progressively deeper processor sleep states. C-State zero represents a processor that is not idle. C-State 1 is an idle state, but it is a very "​shallow"​ idle state so it takes almost no time for the processor to enter and exit C-State 1 (around 1 us). This means that going in and out of C-State 1 will not create noticeable gaps in a trace.+A max_cstate kernel parameter can be used to limit the maximum C-State. Limiting the maximum C-State to 1 will prevent having ​noticeable ​gaps in full function traces. Briefly, C-States are different power saving idle states. C-States 1 and up are progressively deeper processor sleep states. C-State zero represents a processor that is not idle. C-State 1 is an idle state, but it is a very "​shallow"​ idle state so it takes almost no time for the processor to enter and exit C-State 1 (around 1 us). This means that going in and out of C-State 1 will not create noticeable gaps in a trace.
  
 There are two max_cstate boot parameters that can be used for this, processor.max_cstate (which limits the maximum C-State for the acpi_idle driver) and intel_idle.max_cstate (which limits the maximum C-state for the intel_idle driver). The value of one of these parameters must be set to 1 (e.g. intel_idle.max_cstate=1). Only one of these boot parameters needs to be specified in the command-line depending on which idle driver is used by the kernel. The idle driver that is currently loaded can be checked via sysfs: There are two max_cstate boot parameters that can be used for this, processor.max_cstate (which limits the maximum C-State for the acpi_idle driver) and intel_idle.max_cstate (which limits the maximum C-state for the intel_idle driver). The value of one of these parameters must be set to 1 (e.g. intel_idle.max_cstate=1). Only one of these boot parameters needs to be specified in the command-line depending on which idle driver is used by the kernel. The idle driver that is currently loaded can be checked via sysfs:
Line 74: Line 74:
 ==== Change parameter permanently ==== ==== Change parameter permanently ====
  
-To make the option changes persistent when the system is restarted, add idle=poll to the contents of the GRUB_CMDLINE_LINUX field in the /​etc/​default/​grub file. The user must be root or use sudo to modify this file. Here is an example of what the line in the file could look like after being modified:+To make the option changes persistent when the system is restarted, add the parameter and its desired value (e.g. idle=pollto the contents of the GRUB_CMDLINE_LINUX field in the /​etc/​default/​grub file. The user must be root or use sudo to modify this file. Here is an example of what the line in the file could look like after being modified:
  
 <​code>​ <​code>​
Line 94: Line 94:
 </​code>​ </​code>​
  
-To make the temporary change, add idle=poll to the end of the line so that it looks like this:+To make the temporary change, add the kernel parameter and its value (e.g. idle=pollto the end of the line so that it looks like this:
  
 <​code>​ <​code>​
Line 110: Line 110:
 </​code>​ </​code>​
  
-and make sure that idle=poll is somewhere in the output.+and make sure that the kernel parameter and its value (e.g. idle=pollis somewhere in the output.
realtime/documentation/howto/debugging/no-cpu-idle.1535362769.txt.gz ยท Last modified: 2018/08/27 09:39 by ebugden