summaryrefslogtreecommitdiffstats
path: root/source/a/sysvinit-scripts/scripts/rc.cpufreq
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2016-06-30 20:26:57 +0000
committer Eric Hameleers <alien@slackware.com>2018-05-31 23:31:18 +0200
commitd31c50870d0bee042ce660e445c9294a59a3a65b (patch)
tree6bfc0de3c95267b401b620c2c67859557dc60f97 /source/a/sysvinit-scripts/scripts/rc.cpufreq
parent76fc4757ac91ac7947a01fb7b53dddf9a78a01d1 (diff)
downloadcurrent-d31c50870d0bee042ce660e445c9294a59a3a65b.tar.gz
current-d31c50870d0bee042ce660e445c9294a59a3a65b.tar.xz
Slackware 14.2slackware-14.2
Thu Jun 30 20:26:57 UTC 2016 Slackware 14.2 x86_64 stable is released! The long development cycle (the Linux community has lately been living in "interesting times", as they say) is finally behind us, and we're proud to announce the release of Slackware 14.2. The new release brings many updates and modern tools, has switched from udev to eudev (no systemd), and adds well over a hundred new packages to the system. Thanks to the team, the upstream developers, the dedicated Slackware community, and everyone else who pitched in to help make this release a reality. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. Have fun! :-)
Diffstat (limited to 'source/a/sysvinit-scripts/scripts/rc.cpufreq')
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.cpufreq48
1 files changed, 48 insertions, 0 deletions
diff --git a/source/a/sysvinit-scripts/scripts/rc.cpufreq b/source/a/sysvinit-scripts/scripts/rc.cpufreq
new file mode 100644
index 000000000..571ce41c7
--- /dev/null
+++ b/source/a/sysvinit-scripts/scripts/rc.cpufreq
@@ -0,0 +1,48 @@
+#!/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.
+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