Skip to content

Commit

Permalink
[kernel] Change grub cmdline to set c-states to 0 for "Intel" CPUs (s…
Browse files Browse the repository at this point in the history
…onic-net#6051)

Usually for a use case like networking - should not be configured to reach c6, the maximum used is c1e – due to the added latency getting in & out of states (bad for networking).

Following a recommendation by Intel, networking system should avoid getting in & out of states which introduce latency. The recommended state is c1e and no state change enabling.

In addition, c-state sole purpose is to save power and when inside a networking switch its really negligent being such a tiny consumer vs. the whole cluster.

Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
  • Loading branch information
shlomibitton authored Dec 7, 2020
1 parent 3b04da9 commit 43a32e6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion installer/x86_64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,17 @@ trap_push "rm $grub_cfg || true"
[ -r ./platform.conf ] && . ./platform.conf
# Check if the CPU vendor is 'Intel' and disable c-states if True
CPUVENDOR=$(cat /proc/cpuinfo | grep -m 1 vendor_id | awk '{print $3}')
echo "Switch CPU vendor is: $CPUVENDOR"
if [[ $(echo $CPUVENDOR | grep -i "Intel") ]] ; then
CSTATES="intel_idle.max_cstate=0"
else
CSTATES=""
fi
DEFAULT_GRUB_SERIAL_COMMAND="serial --port=${CONSOLE_PORT} --speed=${CONSOLE_SPEED} --word=8 --parity=no --stop=1"
DEFAULT_GRUB_CMDLINE_LINUX="console=tty0 console=ttyS${CONSOLE_DEV},${CONSOLE_SPEED}n8 quiet"
DEFAULT_GRUB_CMDLINE_LINUX="console=tty0 console=ttyS${CONSOLE_DEV},${CONSOLE_SPEED}n8 quiet $CSTATES"
GRUB_SERIAL_COMMAND=${GRUB_SERIAL_COMMAND:-"$DEFAULT_GRUB_SERIAL_COMMAND"}
GRUB_CMDLINE_LINUX=${GRUB_CMDLINE_LINUX:-"$DEFAULT_GRUB_CMDLINE_LINUX"}
export GRUB_SERIAL_COMMAND
Expand Down

0 comments on commit 43a32e6

Please sign in to comment.