Add MAX CSTATE
This commit is contained in:
parent
ac97265b9b
commit
776cdf6e92
@ -1,2 +1,3 @@
|
|||||||
CPU_GOVERNOR="performance"
|
CPU_GOVERNOR="performance"
|
||||||
|
CPU_CSTATE_MAX="C1"
|
||||||
CPU_CSTATES_DISABLE_BY_LATENCY="3"
|
CPU_CSTATES_DISABLE_BY_LATENCY="3"
|
||||||
|
|||||||
@ -26,8 +26,21 @@ else
|
|||||||
echo "CPU governor is not set."
|
echo "CPU governor is not set."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set the Cstate by Max C-State
|
||||||
|
if [ ! "${CPU_CSTATE_MAX}" == "" ]; then
|
||||||
|
print_header "Setting CPU CStates to max \"${CPU_CSTATE_MAX}\""
|
||||||
|
CPU_POWER_SET_ACTION="-e"
|
||||||
|
CPU_POWER_CSTATE=0
|
||||||
|
for CPU_CSTATE_NAME in /sys/devices/system/cpu/cpu0/cpuidle/state*/name; do
|
||||||
|
cpupower idle-set "${CPU_POWER_SET_ACTION}" "${CPU_POWER_CSTATE}" &> /dev/null
|
||||||
|
CPU_POWER_CSTATE=$((CPU_POWER_CSTATE+1))
|
||||||
|
if grep -q "\b${CPU_CSTATE_MAX}\b" "${CPU_CSTATE_NAME}"; then
|
||||||
|
CPU_POWER_SET_ACTION="-d"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
cpupower idle-info
|
||||||
# Set the Cstate by latency
|
# Set the Cstate by latency
|
||||||
if [ ! "${CPU_CSTATES_DISABLE_BY_LATENCY}" == "" ]; then
|
elif [ ! "${CPU_CSTATES_DISABLE_BY_LATENCY}" == "" ]; then
|
||||||
print_header "Setting CPU CStates by latency to ${CPU_CSTATES_DISABLE_BY_LATENCY}"
|
print_header "Setting CPU CStates by latency to ${CPU_CSTATES_DISABLE_BY_LATENCY}"
|
||||||
cpupower idle-set --disable-by-latency "${CPU_CSTATES_DISABLE_BY_LATENCY}" &> /dev/null
|
cpupower idle-set --disable-by-latency "${CPU_CSTATES_DISABLE_BY_LATENCY}" &> /dev/null
|
||||||
cpupower idle-info
|
cpupower idle-info
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user