mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 13:09:21 +01:00
a63882bece
PR-URL: https://github.com/nodejs/node/pull/54723 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
25 lines
418 B
Bash
Executable File
25 lines
418 B
Bash
Executable File
#!/bin/sh
|
|
|
|
CPUPATH=/sys/devices/system/cpu
|
|
|
|
MAXID=$(cat $CPUPATH/present | awk -F- '{print $NF}')
|
|
|
|
set_governor() {
|
|
echo "Setting CPU frequency governor to \"$1\""
|
|
i=0
|
|
while [ "$i" -le "$MAXID" ]; do
|
|
echo "$1" > "$CPUPATH/cpu$i/cpufreq/scaling_governor"
|
|
i=$((i + 1))
|
|
done
|
|
}
|
|
|
|
case "$1" in
|
|
fast | performance)
|
|
set_governor "performance"
|
|
;;
|
|
*)
|
|
echo "Usage: $0 fast"
|
|
exit 1
|
|
;;
|
|
esac
|