[SOLVED] With Linux more waste of resource as with Windows
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
since last Friday I have my new PC. I installed Slackware as well as Windows (for some Games). Under Windows I have a program to regulate the perfomance, so if I do nothing or simple things that do not need the full power, my PC is quiet and uses less power (I can see it with Watt/Ampere meter...). I have currently around 155 Watt and the CPU fan is really loud -- compared to Windows.
Is there any way to regulate this with Linux?
My mainboard is an Asus M4N75TD and I have an AMD Phenom II X4 965 CPU.
You need to make sure CPU frequency scaling is turned on and set to "ondemand". Most Linux distributions do not set that up out of the box.
Run lsmod | grep powernow-k8 to confirm that your CPU frequency scaling module is loaded. If it isn't, execute modprobe powernow-k8 and add the command to rc.local.
Then set your CPU frequency scaling governor to "ondemand":
Code:
ls /sys/devices/system/cpu*/cpufreq/scaling_governor | xargs -i echo ondemand > {}
You need to make sure CPU frequency scaling is turned on and set to "ondemand". Most Linux distributions do not set that up out of the box.
Run lsmod | grep powernow-k8 to confirm that your CPU frequency scaling module is loaded. If it isn't, execute modprobe powernow-k8 and add the command to rc.local.
Then set your CPU frequency scaling governor to "ondemand":
Code:
ls /sys/devices/system/cpu*/cpufreq/scaling_governor | xargs -i echo ondemand > {}
Put that command in rc.local too.
Thanks. I added it. Until now, no changes. :S
Your "change" in /sys has a little typo, it must be:
Code:
ls /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | xargs -i echo ondemand > {}
Now I'm waiting for some mysterious things to happen. ^^ Perhaps I should read a bit about PowerNow -- with my old PC I didn't care because it was years old and I didn't have a wattmeter.
_____________________________________________
While I was adding your two commands to rc.local I was considering to move modprobe powernow-k8 to rc.modules and then I found this:
Code:
### Enable CPU frequency scaling if requested:
if [ "$CPUFREQ" = "on" ]; then
### CPU frequency scaling modules for the Linux kernel CPUfreq subsystem.
#
# Clock scaling allows you to change the clock speed of the CPUs on the fly.
# This is a nice method to save battery power, because the lower the clock
# speed is, the less power the CPU consumes.
#
# It should not hurt anything to try to load these modules.
#
# generic ACPI P-States based driver:
/sbin/modprobe acpi-cpufreq 2>/dev/null
# AMD mobile K6-2/3+ PowerNow!:
/sbin/modprobe powernow-k6 2>/dev/null
# AMD mobile Athlon PowerNow!:
/sbin/modprobe powernow-k7 2>/dev/null
# AMD Cool&Quiet PowerNow!:
/sbin/modprobe powernow-k8 2>/dev/null
# Intel SpeedStep using the SMI BIOS interface:
/sbin/modprobe speedstep-smi 2>/dev/null
# Intel SpeedStep on ICH-based chipsets:
/sbin/modprobe speedstep-ich 2>/dev/null
# Intel Enhanced SpeedStep :
/sbin/modprobe speedstep-centrino 2>/dev/null
# Intel Pentium4/Xeon clock modulation is not enabled by default.
# The kernel documentation says "This adds the CPUFreq driver for Intel
# Pentium 4 / XEON processors. When enabled it will lower CPU temperature
# by skipping clocks. This driver should be only used in exceptional
# circumstances when very low power is needed because it causes severe
# slowdowns and noticeable latencies. Normally Speedstep should be used
# instead."
# If you still want to try the Pentium4/Xeon module, uncomment the next line:
#/sbin/modprobe p4-clockmod 2>/dev/null
# NatSemi Geode GX / Cyrix MediaGXm:
/sbin/modprobe gx-suspmod 2>/dev/null
# Transmeta Crusoe / Efficeon LongRun:
/sbin/modprobe longrun 2>/dev/null
# VIA Cyrix Longhaul:
/sbin/modprobe longhaul 2>/dev/null
# nForce2 FSB changing cpufreq driver:
/sbin/modprobe cpufreq-nforce2 2>/dev/null
# Enhanced PowerSaver driver for VIA C7 CPUs:
/sbin/modprobe e_powersaver 2>/dev/null
### CPU frequency scaling policies:
#
# Use the CPUFreq governor 'powersave' as default. This sets the
# frequency statically to the lowest frequency supported by the CPU.
#/sbin/modprobe cpufreq_powersave
#
# Use the CPUFreq governor 'performance' as default. This sets the
# frequency statically to the highest frequency supported by the CPU.
#/sbin/modprobe cpufreq_performance
#
# Use the CPUFreq governor 'conservative' as default. This allows you
# to get a full dynamic frequency capable system by simply loading your
# cpufreq low-level hardware driver. Be aware that not all cpufreq
# drivers support the 'conservative' governor -- the fallback governor
# will be the 'performance' governor.
#/sbin/modprobe cpufreq_conservative
#
# Use the CPUFreq governor 'ondemand' as default. This allows you to
# get a full dynamic frequency capable system by simply loading your
# cpufreq low-level hardware driver. Be aware that not all cpufreq
# drivers support the 'ondemand' governor -- the fallback governor will
# be the performance governor. This seems to be the most-recommended
# scaling policy, so rc.modules will try to load this by default.
/sbin/modprobe cpufreq_ondemand 2>/dev/null
### CPU scaling governor:
#
# Set the default scaling_governor to be used (such as userspace or ondemand)
# if there is a CPUFreq scaling policy module loaded that supports it:
SCALING_GOVERNOR=ondemand
#
# Try to enable the scaling_governor selected above:
if [ -r /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors ]; then
if grep -wq "$SCALING_GOVERNOR" /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors ; then
if [ -r /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ]; then
for SYSCPUFILE in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor ; do
echo "$SCALING_GOVERNOR" > $SYSCPUFILE
done
fi
fi
fi
fi # End enabling CPU scaling support
I should probably set $CPUFREQ somewhere to "on" instead?
____
OK, some lines above this code I pasted is the declaration of $CPUFREQ. I set it to "on" and restartd and saw an output at start time:
Quote:
powernow: This module only works with AMD K7 CPUs
powernow-k8: Found 1 AMD Phenom(tm) II X4 965 Processor (4 cpu cores) (version 2.20.00)
powernow-k8: 0 : pstate 0 (3400 MHz)
powernow-k8: 1 : pstate 1 (2700 MHz)
powernow-k8: 2 : pstate 2 (2200 MHz)
powernow-k8: 3 : pstate 3 (800 MHz)
cpufreq-nforce2: No nForce2 chipset.
It seems to work, thank you. But I think I still need to read more about PowerNow.
If you want to see the effect, you can look at the "cpuinfo_max_freq" and "cpuinfo_cur_freq" files in each cpufreq directory, to see what your CPU is capable of and what it's been throttled to.
All I had to do was change "CPUFREQ=battery" to "CPUFREQ=on" in /etc/rc.d/rc.modules to get frequency scaling to work on a Athlon II 235e. After this frequency scaling should start automatically next time you re-boot.
Also, those who really really want to reduce power consumption when idle can try turning off their cores:
Code:
echo 0 >> /sys/devices/system/cpu/cpu1/online
This is for core #2 (#1 is cpu0). On dual core systems, a single core waking up to high frequencies might be worse than two cores with light load, but I believe for 3 or more cores turning off unneeded cores may save power.
Multicore-CPUs should bring unused cores to the different sleep-states, so I think turning cores off will not bring a noticable saving.
It will bring more to get it from the other end. Choose your PSU according to your needs, no need for a 600W-PSU in an office-pc. Choose models with high efficiency, at least with 80Plus certificate (have a look here: 80 Plus PSU List).
Also the graphicscard can be very power consuming. Choose your moddel according to your needs (again, no need for a gaming card in an office-pc) and read reviews on the Internet. I bought my graphicscard and recognized to late that my modell ha no powersaving options, because it is overclocked by the manufacturer.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.