LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-20-2010, 02:54 PM   #1
Squall90
Member
 
Registered: Oct 2009
Distribution: Currently several distros :S
Posts: 148

Rep: Reputation: 29
With Linux more waste of resource as with Windows


Hi,

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.

Thanks.
 
Old 09-20-2010, 03:13 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,220

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
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.
 
1 members found this post helpful.
Old 09-20-2010, 03:14 PM   #3
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,526

Rep: Reputation: 53
You will want to look into CPU frquency scaling which is availble in Slackware. There are a number of guides for this, but here is one:

DELETED THE LINK. dugan's info is all that you need.

Bob

Last edited by BobNutfield; 09-20-2010 at 03:29 PM.
 
Old 09-20-2010, 03:36 PM   #4
Squall90
Member
 
Registered: Oct 2009
Distribution: Currently several distros :S
Posts: 148

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by dugan View Post
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.

Last edited by Squall90; 09-21-2010 at 12:56 AM.
 
Old 09-20-2010, 03:56 PM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,220

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
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.
 
1 members found this post helpful.
Old 09-20-2010, 04:08 PM   #6
sparkyhall
Member
 
Registered: Nov 2009
Location: Chatteris---UK
Distribution: Slackware 13.0 & 14.0
Posts: 42

Rep: Reputation: 8
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.
 
Old 09-21-2010, 12:00 PM   #7
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,157

Rep: Reputation: 237Reputation: 237Reputation: 237
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.
 
Old 09-21-2010, 12:17 PM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.
 
Old 09-22-2010, 02:17 AM   #9
Squall90
Member
 
Registered: Oct 2009
Distribution: Currently several distros :S
Posts: 148

Original Poster
Rep: Reputation: 29
For office computers on-board graphic cards are OK, I think. They do their job and they probably need less power.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Loving Ubuntu after 15 years of waste in windows inspiron_Droid General 6 10-06-2008 06:50 PM
Why installing Linux is never a waste of time samwise17 LinuxQuestions.org Member Success Stories 1 12-07-2007 01:39 PM
LXer: Only 'freaks' waste their time with Linux in Oklahoma LXer Syndicated Linux News 0 04-07-2006 10:33 PM
Linux is a waste of time! tripmix General 17 12-21-2004 05:11 PM
Any Linux Vs Windows 2000 Security resource? neelay1 Linux - Security 1 12-07-2004 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration