slackware-current/source/a/sysvinit-scripts/scripts/rc.cpufreq
Patrick J Volkerding 646a5c1cbf Mon May 28 19:12:29 UTC 2018
a/pkgtools-15.0-noarch-13.txz:  Rebuilt.
  installpkg: default line length for --terselength is the number of columns.
  removepkg: added --terse mode.
  upgradepkg: default line length for --terselength is the number of columns.
  upgradepkg: accept -option in addition to --option.
ap/vim-8.1.0026-x86_64-1.txz:  Upgraded.
d/bison-3.0.5-x86_64-1.txz:  Upgraded.
e/emacs-26.1-x86_64-1.txz:  Upgraded.
kde/kopete-4.14.3-x86_64-8.txz:  Rebuilt.
  Recompiled against libidn-1.35.
n/conntrack-tools-1.4.5-x86_64-1.txz:  Upgraded.
n/libnetfilter_conntrack-1.0.7-x86_64-1.txz:  Upgraded.
n/libnftnl-1.1.0-x86_64-1.txz:  Upgraded.
n/links-2.16-x86_64-2.txz:  Rebuilt.
  Rebuilt to enable X driver for -g mode.
n/lynx-2.8.9dev.19-x86_64-1.txz:  Upgraded.
n/nftables-0.8.5-x86_64-1.txz:  Upgraded.
n/p11-kit-0.23.11-x86_64-1.txz:  Upgraded.
n/ulogd-2.0.7-x86_64-1.txz:  Upgraded.
n/whois-5.3.1-x86_64-1.txz:  Upgraded.
xap/network-manager-applet-1.8.12-x86_64-1.txz:  Upgraded.
xap/vim-gvim-8.1.0026-x86_64-1.txz:  Upgraded.
2018-05-31 23:39:35 +02:00

52 lines
2.6 KiB
Bash

#!/bin/sh
#
# rc.cpufreq: Settings for CPU frequency and voltage scaling in the kernel.
# For more information, see the kernel documentation in
# /usr/src/linux/Documentation/cpu-freq/
# Default CPU scaling governor to try. Some possible choices are:
# performance: The CPUfreq governor "performance" sets the CPU statically
# to the highest frequency within the borders of scaling_min_freq
# and scaling_max_freq.
# powersave: The CPUfreq governor "powersave" sets the CPU statically to the
# lowest frequency within the borders of scaling_min_freq and
# scaling_max_freq.
# userspace: The CPUfreq governor "userspace" allows the user, or any
# userspace program running with UID "root", to set the CPU to a
# specific frequency by making a sysfs file "scaling_setspeed"
# available in the CPU-device directory.
# ondemand: The CPUfreq governor "ondemand" sets the CPU depending on the
# current usage.
# conservative: The CPUfreq governor "conservative", much like the "ondemand"
# governor, sets the CPU depending on the current usage. It
# differs in behaviour in that it gracefully increases and
# decreases the CPU speed rather than jumping to max speed the
# moment there is any load on the CPU.
# schedutil: The CPUfreq governor "schedutil" aims at better integration with
# the Linux kernel scheduler. Load estimation is achieved through
# the scheduler's Per-Entity Load Tracking (PELT) mechanism, which
# also provides information about the recent load.
SCALING_GOVERNOR=ondemand
# If rc.cpufreq is given an option, use it for the CPU scaling governor instead:
if [ ! -z "$1" -a "$1" != "start" ]; then
SCALING_GOVERNOR=$1
fi
# If you need to load a specific CPUFreq driver, load it here. Most likely you don't.
#/sbin/modprobe acpi-cpufreq
# Attempt to apply the CPU scaling governor setting. This may or may not
# actually override the default value depending on if the choice is supported
# by the architecture, processor, or underlying CPUFreq driver. For example,
# processors that use the Intel P-state driver will only be able to set
# performance or powersave here.
echo $SCALING_GOVERNOR | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 1> /dev/null 2> /dev/null
# Report what CPU scaling governor is in use after applying the setting:
if [ -r /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ]; then
echo "Enabled CPU frequency scaling governor: $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)"
fi
unset SCALING_GOVERNOR