29 lines
652 B
Bash
Executable File
29 lines
652 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Based on the values (1-enable, 0-disable) for these controls,
|
|
# sched groups cpu power will be determined for different domains.
|
|
# When power savings policy is enabled and under light load conditions,
|
|
# scheduler will minimize the physical packages/cpu cores carrying the
|
|
# load and thus conserving power
|
|
|
|
sched_powersave() {
|
|
for pool in mc smp smt; do
|
|
dev="/sys/devices/system/cpu/sched_${pool}_power_savings"
|
|
[ -w "$dev" ] || continue
|
|
echo $1 > "$dev"
|
|
done
|
|
}
|
|
|
|
case "$1" in
|
|
true)
|
|
echo "**sched policy powersave ON"
|
|
sched_powersave 1
|
|
;;
|
|
false)
|
|
echo "**sched policy powersave OFF"
|
|
sched_powersave 0
|
|
;;
|
|
esac
|
|
|
|
exit 0
|