Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Longer battery life for Athlon64 and Turion laptops
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
Elmo234
n00b
n00b


Joined: 08 Oct 2004
Posts: 48

PostPosted: Wed Mar 15, 2006 10:15 pm    Post subject: Longer battery life for Athlon64 and Turion laptops Reply with quote

Hi!

I started developing a new program. The first version is out now :)
It is a daemon to replace powernowd, cpufreqd, etc...

It is more configurable and it lets you override the voltage of AMD K8 core cpu's (Athlon 64, Opteron and some Semprons) and Pentuim-M (centrino) and Celeron-M from Intel.

After a few test I found that my athlon 64 processor was able to work at 1,2v at 1800Mhz and 0,8v at 800Mhz (AMD it has to work at 1,5 and 1,1v). This makes the cpu run cooler and I have almos 30 minutes more of battery life.

So you can have a try if you want...

www.tuxamito.com.es/cpupw/ Here you will find a lot more of information.

Please, write your comments...
Back to top
View user's profile Send private message
Gnufsh
Guru
Guru


Joined: 28 Dec 2002
Posts: 400
Location: Portland, OR

PostPosted: Thu Mar 16, 2006 1:04 am    Post subject: Reply with quote

Sounds interesting. Planning on writing an ebuild for it?
Back to top
View user's profile Send private message
mudrii
l33t
l33t


Joined: 26 Jun 2003
Posts: 789
Location: Singapore

PostPosted: Thu Mar 16, 2006 8:23 am    Post subject: Reply with quote

Nice and really cool if you can make an ebuild.

Is it work on Big AMD 64 dual core too ?
_________________
www.gentoo.ro
Back to top
View user's profile Send private message
Elmo234
n00b
n00b


Joined: 08 Oct 2004
Posts: 48

PostPosted: Thu Mar 16, 2006 8:55 am    Post subject: Reply with quote

Yes it works for dual core cpus. I tested it on mine :)

It is also supposed to work on multi cpu systems and hybrid systems (1 dual core cpu and a single core cpu)... But I haven't tested that...

This is just the first release. Next week I will release a new version that solves some isues. I also want to make some scrips for starting / stopping the daemon.

Then I will try to write and ebuild. The problem is that I have never written one. I hope it is not too difficult :)
Back to top
View user's profile Send private message
Plugin_baby
n00b
n00b


Joined: 18 Aug 2005
Posts: 26
Location: The Netherlands

PostPosted: Thu Mar 16, 2006 9:15 am    Post subject: Reply with quote

Sounds good, the short battery life of my turion64 laptop really annoys me...

Elmo234, you say you get an extra 30 min. with this, how long do you have in total?
At 800MHz (ondemand) I still only get about 2 hours.
I know that battery life also depends on the model, but I'm curious about what others are able to get ;)
Back to top
View user's profile Send private message
Elmo234
n00b
n00b


Joined: 08 Oct 2004
Posts: 48

PostPosted: Thu Mar 16, 2006 9:31 am    Post subject: Reply with quote

My notebook is an ACER 1501 LMI with an Athlon 64 DTR processor. At 800 Mhz I can change voltage from 1,1 to 0,8v. That reduces the energy needed by the cpu in a 47%. This pushes battery life from 2 hours 30 minutes to over 3 hours.

But in a Turion system you won't be able to reach such a high difference because you processor uses lover voltage by default and because Turion uses about half energy that an old Athlon 64 DTR.

But you can try it. Maybe you have 15 or 20 minutes more of battery life. :)
Back to top
View user's profile Send private message
Elmo234
n00b
n00b


Joined: 08 Oct 2004
Posts: 48

PostPosted: Sun Mar 19, 2006 10:24 pm    Post subject: Reply with quote

I just released a new version (0.1.1) that solves some bugs. The ebuild will come soon (in two or three days).
Back to top
View user's profile Send private message
Voluspa
n00b
n00b


Joined: 20 Mar 2006
Posts: 3
Location: Sweden

PostPosted: Mon Mar 20, 2006 11:30 pm    Post subject: Reply with quote

Ever since Linus "stole" my one and only C-state for reducing power usage in kernel 2.6.15 (see http://bugzilla.kernel.org/show_bug.cgi?id=5767 ), I've patched it back with:

Code:

diff -Nur linux-2.6.16-original/drivers/acpi/processor_idle.c linux-2.6.16-patched/drivers/acpi/processor_idle.c
--- linux-2.6.16-original/drivers/acpi/processor_idle.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-patched/drivers/acpi/processor_idle.c  2006-03-20 20:24:10.000000000 +0100
@@ -953,7 +953,7 @@
        for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
                if (pr->power.states[i].valid) {
                        pr->power.count = i;
-                       if (pr->power.states[i].type >= ACPI_STATE_C2)
+                       if (pr->power.states[i].type >= ACPI_STATE_C1)
                                pr->flags.power = 1;
                }
        }


But this is merely a trickle gain in comparison with the CPUPW program's undervolting feature. I registered on the ge
ntoo board just to give praise and thanks to the author in a public manner.

The Acer Aspire 1520 (1524) WLMi on my lap is a powerful machine: AMD Athlon64 Processor 3400+, 1 meg L2 cache, NVIDIA GeForce FX Go5700 64 meg and 2 gig system memory. The drawbacks are of course heat, fan noise and a short battery life - some 2 hours doing light work, connected through the builtin wireless LAN device.

CPUPW gives me another 30 minutes! Heat is lower, as could be expected, and the fan never reaches MAX, out of four levels: OFF - only when room temperature is quite chilly, LOW - normal state, MEDIUM - CPU 99% when compiling etc, MAX - previous level when eg playing a demanding game.

Configuration of CPUPW was a breeze, though I'd like to expand on a couple of points not mentioned in the online documentation. First, make sure that PowerNowd or other managers are unloaded. Second, cat the /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor and ensure that it says "userspace". Third, verify that all your voltage settings are adequately high by running eg a very demanding game.

I myself discovered that the value for 2000 MHz needed another 50 mV when Neverwinter Nights kept crashing at a certain spot (a wood with plenty of light beams streaming down through the treetop canopy - think it's called Druids Camp or something such). Finding the culprit speed was simple. I left the 2200 and 800 voltage values as they were - deduced by looking up the powernow-k8 reporting in the kernel log file and comparing it to the CPUPW online examples, while disabling the 2000 and 1800 speed voltages with a -1 value. No crash. I then added back the 1800 value. No crash. Added the 2000 value plus 50 mV. No crash. Done.

CPUPW also has a very good frequency management. When I installed PowerNowd I took that author's defaults on faith. Result was that eg drawing in Gimp could trigger the fan into MEDIUM level. And Neverwinter Nights... well, the fanless GPU reached its slowdown threshold (115C) and CPU fan was constantly on MAX. With CPUPW - run as /usr/sbin/cpupw --config /etc/cpupw.conf --smart --daemonize - both these programs use exactly the CPU speed they need. Gimp drawing always on LOW fan, NWN on MEDIUM and the GPU never reaching the slowdown threshold temperature.

So, in conclusion, the CPUPW program has indeed "made my day". A heartfelt thank you goes to the author Daniel(?). At version 0.1.1 I've only seen one issue. Kernel log file is sprinkled with:

Mar 20 18:07:42 ... powernow-k8: error - out of sync, fix 0x0 0x0, vid 0x1e 0x12
[...]
Mar 20 19:51:49 ... powernow-k8: error - out of sync, fix 0xa 0xa, vid 0x16 0xa
[...]
Mar 20 20:03:28 ... powernow-k8: error - out of sync, fix 0x0 0x0, vid 0x1e 0x12

The more frequency switching, the more of these messages. Below is a table of my machine values followed by the actual cpupw.conf:

Code:

AMD Athlon64 Processor 3400+ defaults:

FID (decimal)   MHz     VID (decimal)   mV
14              2200    2               1500
12              2000    6               1400
10              1800    10              1300
0               800     18              1100

Idle machine running Xorg and KDE at 800 MHz in 24C room temperature:

CPU core 49-50C
CPU env. 48C

After the CPUPW implementation:

FID (decimal)   MHz     VID (decimal)   mV (Values deduced - lower not tested)
14              2200    14              1200
12              2000    16              1150 (50 mV extra to NeverWinter Nights)
10              1800    22              1000
0               800     30              800

Idle machine running Xorg and KDE at 800 MHz in 24C room temperature:

CPU core 46-47C
CPU env. 45-47C


1
1
304
4
2200000 14 -1 -1
2000000 16 -1 -1
1800000 22 -1 -1
800000 30 -1 -1
1
_________________
Mvh
Mats Johannesson
Back to top
View user's profile Send private message
Elmo234
n00b
n00b


Joined: 08 Oct 2004
Posts: 48

PostPosted: Tue Mar 21, 2006 6:20 pm    Post subject: Reply with quote

Thank you Voluspa for such a great comment to the program. And thanks for thanking me :)

Voluspa wrote:

The Acer Aspire 1520 (1524) WLMi on my lap is a powerful machine: AMD Athlon64 Processor 3400+, 1 meg L2 cache, NVIDIA GeForce FX Go5700 64 meg and 2 gig system memory. The drawbacks are of course heat, fan noise and a short battery life - some 2 hours doing light work, connected through the builtin wireless LAN device.

CPUPW gives me another 30 minutes! Heat is lower, as could be expected, and the fan never reaches MAX, out of four levels: OFF - only when room temperature is quite chilly, LOW - normal state, MEDIUM - CPU 99% when compiling etc, MAX - previous level when eg playing a demanding game.

I have an Acer Aspire 1501LMi (Athlon 64 DTR 3000+) with 2.5 hours of battery life (3 with CPUPW, and, like in you laptop, it never reaches MAX fan speed).

Voluspa wrote:

Configuration of CPUPW was a breeze, though I'd like to expand on a couple of points not mentioned in the online documentation. First, make sure that PowerNowd or other managers are unloaded. Second, cat the /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor and ensure that it says "userspace". Third, verify that all your voltage settings are adequately high by running eg a very demanding game.

I know that the making a configuration file is a bit difficult. When I started this program I didn't want to lose time making a parser for a more complex and easy to read (and write) configuration file. But in the future I will change it...
I will also write that information in the webpage. It is very useful for other users to know.

Voluspa wrote:

Finding the culprit speed was simple. I left the 2200 and 800 voltage values as they were - deduced by looking up the powernow-k8 reporting in the kernel log file and comparing it to the CPUPW online examples, while disabling the 2000 and 1800 speed voltages with a -1 value. No crash. I then added back the 1800 value. No crash. Added the 2000 value plus 50 mV. No crash. Done.

This has to be done for each computer :( Nobody knows which are the lowest values of voltage for a CPU to work stable...

Voluspa wrote:

So, in conclusion, the CPUPW program has indeed "made my day". A heartfelt thank you goes to the author Daniel(?).

Thank you very much :) I coded this program for myself and for fun. But I am glad to know that it is useful to other people. Yes, my name is Daniel.

Voluspa wrote:

At version 0.1.1 I've only seen one issue. Kernel log file is sprinkled with:

Mar 20 18:07:42 ... powernow-k8: error - out of sync, fix 0x0 0x0, vid 0x1e 0x12
[...]
Mar 20 19:51:49 ... powernow-k8: error - out of sync, fix 0xa 0xa, vid 0x16 0xa
[...]
Mar 20 20:03:28 ... powernow-k8: error - out of sync, fix 0x0 0x0, vid 0x1e 0x12

The more frequency switching, the more of these messages. Below is a table of my machine values followed by the actual cpupw.conf:

I know this... and I think I know why this happens. I am trying to fix it (in fact the change from version 0.1.0 to 0.1.1 reduces this by an 80% aprox).

Now I am really busy with university, but in a week I will release a new version with a few bug fixed and new features.
Back to top
View user's profile Send private message
Voluspa
n00b
n00b


Joined: 20 Mar 2006
Posts: 3
Location: Sweden

PostPosted: Fri Mar 24, 2006 5:01 am    Post subject: Reply with quote

I've read the interesting (and long-running) gentoo AMD64 thread on undervolting, where hopes of a kernel or at least a distributor patch acceptance is expressed. That will probably never happen. Operating out of spec, even if it is a user choice, would place them in a most unwanted liability. Consider for example the powersaving AMDK7 patch that has been floating around since 2002. Len Brown, the ACPI maintainer from Intel, had some final strong words:

[PATCH] amd76x_pm: C3 powersaving for AMD K7
Thread start http://marc.theaimsgroup.com/?l=linux-acpi&m=113873375729153&w=2
--quote Len Brown http://marc.theaimsgroup.com/?l=linux-acpi&m=113895655522773&w=2 --
[...]
How about if we put it this way...
If the ACPI maintainer were an AMD employee,
and he accepted a patch like this specific to Intel hardware --
a patch that rejects whatever validation Intel, the BIOS
vendor and the board vendor have put into the product --
I'd call for his expulsion for ineptitude.

If somebody from AMD steps forth and says that hey, their hardware
is broken if used in the standard way, but that this "logic around"
is a valid model-specific workaround -- then we have something
that MAYBE we can work with. Otherwise, do whatever works for your
own system, but it would be reckless of us to put stuff like this
in the upstream kernel and then ask distros to support it.
--end quote--

Undervolting has a strong aura of "recklessness" and a userspace tool like CPUPW could well be the only patch-free avenue for the foreseeable future.

Speaking of which, Daniel, when university has eased its grip could you contemplate a runtime switch along the line of "--maxfreq <frequency>"? When trying out voltages my 2200 and 800 MHz speeds posed no problems. The 800 could be had by using your "--laptop" switch and doing an "echo -n '1'>/proc/sys/vm/laptop_mode", but the intermediate speeds 2000 and 1800 really had me stumped for awhile. Experiments caused a lot of "ignoring illegal change in lo freq table-0 to 0x0 -- transition frequency failed" in /var/log/syslog until I finally could clamp the speed AND retain correct voltage by doing:

echo -n "1800000">/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
(using this cpupw.conf)
1
1
304
4
2200000 22 -1 -1
2000000 22 -1 -1
1800000 22 -1 -1
800000 30 -1 -1
1

echo -n "2000000">/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
(using this cpupw.conf)
1
1
304
4
2200000 16 -1 -1
2000000 16 -1 -1
1800000 22 -1 -1
800000 30 -1 -1
1

Not pretty ;-) If we want to find _stable_ voltages, testing each level is a must. And, as it turns out, that requires quite some work. Taking a hint from the other undervolting thread, I downloaded GIMPS (mprime) http://www.mersenne.org/freesoft.htm and ran the torture test (-t). Heh... my value for 2200 MHz, which was stable in Neverwinter Nights, miscalculated after a mere two minutes. Fixed by upping it another 50 mV. I then ran each speed - deleting local.ini in between - the recommended minimum of six hours without errors.

But, and this really underscores the need for multiple test-tools, entering Neverwinter Nights again I experienced a crash while loading an area. Knowing that this is more disk than CPU bound I guessed that the lower frequencies also needed a little extra juice. Giving both 800 and 1800 speeds another 50 mV and walking around the map for an hour finally convinced me of machine stability.

Examining by "cat /sys/devices/system/cpu/cpu*/cpufreq/stats/trans_table" (cpufreq_stats and freq_table modules loaded or builtin) after the game is another must to verify that you've really exercised all the CPU speeds.

Final cpupw.conf for me, and me only :-)

1
1
304
4
2200000 12 -1 -1
2000000 16 -1 -1
1800000 20 -1 -1
800000 28 -1 -1
1

Ergo:
Code:

FID (decimal)   MHz     VID (decimal)   mV ("mprime -t" and NWN game confirmed)
14              2200    12              1250
12              2000    16              1150
10              1800    20              1050
0               800     28              850


Using these extra 50 mV also seem to have decreased the "out of sync" in /var/log/messages. Coming back from NWN there was only one. Go figure...
_________________
Mvh
Mats Johannesson
Back to top
View user's profile Send private message
octapus
n00b
n00b


Joined: 10 Mar 2003
Posts: 35

PostPosted: Fri Mar 24, 2006 11:28 am    Post subject: Reply with quote

Very useful program indeed.

I have an AMD 64 3200+ and the following working configuration:

1
1
304
3
2000000 16 -1 -1 <= 1150mV from 1500mV
1800000 20 -1 -1 <= 1050mV from 1400mV
1000000 24 -1 -1 <= 950mV from 1150mV
1

Even under full load the second fan is never activated which lowers the amount of noise the laptop generates.

I didn't extensively test the stability but there are no problems till now.

Let me also say that there were messages similar to what was mentioned before ("powernow-k8: error - out of sync.....") from time to time.
Back to top
View user's profile Send private message
widan
Veteran
Veteran


Joined: 07 Jun 2005
Posts: 1512
Location: Paris, France

PostPosted: Fri Mar 24, 2006 10:27 pm    Post subject: Reply with quote

Voluspa wrote:
Kernel log file is sprinkled with:
Code:
Mar 20 18:07:42 ... powernow-k8: error - out of sync, fix 0x0 0x0, vid 0x1e 0x12
Mar 20 19:51:49 ... powernow-k8: error - out of sync, fix 0xa 0xa, vid 0x16 0xa
Mar 20 20:03:28 ... powernow-k8: error - out of sync, fix 0x0 0x0, vid 0x1e 0x12

The powernow driver keeps track of the current fid/vid it sets. Before a transition, it checks to see if the parameters are still what it thinks they are, and gives the out of sync message if something changed (here the vid). AFAIK the frequency transition is still done, this is only a warning message. The messages appear because the cpupw program does the voltage change from userspace (by writing to FID/VID control MSR) and the powernow driver is not notified of the vid change.

Fixing that would require modifying the powernow driver to set the proper voltages directly when it does the frequency transition, rather than modifying them later from userspace. There are patches to do this in the main undervolting thread.
Voluspa wrote:
Experiments caused a lot of "ignoring illegal change in lo freq table-0 to 0x0 -- transition frequency failed" in /var/log/syslog

Either keep the lowest frequency in the table at standard voltage, or force a transition to a higher frequency, then back down to the low frequency to have the correct voltage set. This appears because the powernow driver refuses to do transitions between low FIDs and doesn't allow a voltage-only transition for low FIDs (it thinks the transition is between two different low FIDs, which is not allowed).
Back to top
View user's profile Send private message
superwutze
Tux's lil' helper
Tux's lil' helper


Joined: 09 Dec 2004
Posts: 136
Location: Europe/Vienna

PostPosted: Sat May 20, 2006 1:03 pm    Post subject: Reply with quote

i have some trouble using cpupw.

my system is a tyan s2875 k8w and i have two opterons 246 on it.
cpupw -s gives the following:
Code:
System has 1 physical CPU's
CPU 0-> voltage: 1.550000 v, VID: 0, frequency: 800 Mhz, FID: 0


which is wrong in every single point.
1 have two cpus
they run at 1.2v
they run at 1ghz

but now to my real question: can cpupw change the frequency table too?
i tried several cpupw.conf variations but not a single one showed any alteration to my system.
per default my system has 3 steps (1 1.8 and 2ghz) and i want to change them to 0.8 1.2 1.6 and 2ghz which runs fine in windows with rmclock. could cpupw do this?

i have another question that no one was able to answer so far:
why do i need a daemon to change frequencies?
where is the difference to:
Code:
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor


so far i have used the kernel patch to change voltages but the links to the patches (and the last ones could change the frequency table also) are down, so i have to look for another possibility to do that. and a userspace program is by far better than patching every kernel.
_________________
bill who? micro what?
Back to top
View user's profile Send private message
pagaman
n00b
n00b


Joined: 23 Jan 2004
Posts: 25
Location: London

PostPosted: Fri Jun 02, 2006 9:49 pm    Post subject: Reply with quote

Just a quick note to say thanks.
I've got an Acer aspire 1520 something, and I've just knocked 200mV off all 3 of my settings.
This is great ;)
I can probably knock more off too...

My config:
1
1
304
3
1800000 10 -1 -1
1600000 14 -1 -1
800000 26 -1 -1
1
_________________
History only remembers great people by forgetting their mistakes.
Back to top
View user's profile Send private message
Elmo234
n00b
n00b


Joined: 08 Oct 2004
Posts: 48

PostPosted: Wed Jun 07, 2006 9:17 pm    Post subject: Reply with quote

I just released a new version... cpupw 0.2.0. But I haven't test it much. The main new things are:

- It is supposed tu run on multiprocessor computers (the other versions didn't, there was a bug) and I say supposed because I don't have a multiprocessor system to test.
- Possibility to adjust VID and FID manually.
- Detects which governor is running and gives warnings if it is not "userspace".
- Now the FSB frequency is detected (the theoretical and the real one).
- You can modify the VID by a constant, passed as a parameter. This let's you decrease, for example, 0.2v in every step without creating a config file.

the web page is the same: http://tuxamito.com.es/cpupw/

please, give me your reports

thanks
Back to top
View user's profile Send private message
kristoffer
Tux's lil' helper
Tux's lil' helper


Joined: 05 Oct 2003
Posts: 85

PostPosted: Thu Jun 08, 2006 3:24 pm    Post subject: Reply with quote

This program is great! I'm using it on all of my computers now. I do, however, want to be able to set a bound for the frequency values, i.e. something equivalent to scaling_max_freq and scaling_min_freq, so I did a little hack to add that functionality. In order to apply the hack, put the code below in a patch file in the cpupw-0.2.0/src directory, apply the patch to cpupw.c and compile:
Code:
--- cpupw.c   2006-06-08 17:10:29.000000000 +0200
+++ ../src.mod/cpupw.c   2006-06-08 17:05:32.000000000 +0200
@@ -169,6 +169,8 @@
 int p_changevid = 0;
 int p_governor = 0;
 int p_governor_cpu = -1;
+int p_max_freq = -1;
+int p_min_freq = -1;
 char *s_governor;
 
 /* This controls the loop time and when to exit it */
@@ -797,7 +799,7 @@
 void decide_change (void)
 {
   int i, j;
-  int max, average;
+  int max, average, current;
 
   for(i=0;i<numpcpus;i++)
     {
@@ -824,15 +826,27 @@
         max = (int)average/j;
       }
 
-         if(max > cpus[i].scaling_table[cpus[i].now].up &&
-       cpus[i].scaling_table[cpus[i].now].up >= 0)
+         current = get_actual_speed(i, 2);
+
+         if (p_max_freq != -1 && current > p_max_freq)
+        change_speed(-1, i);
+         else if (p_min_freq != -1 && current < p_min_freq)
+        change_speed(1, i);
+         else if(max > cpus[i].scaling_table[cpus[i].now].up &&
+       cpus[i].scaling_table[cpus[i].now].up >= 0 && (p_max_freq == -1 ||
+       cpus[i].scaling_table[cpus[i].now - 1].speed <= p_max_freq))
       change_speed(1, i);
          else if(max < cpus[i].scaling_table[cpus[i].now].down &&
-            cpus[i].scaling_table[cpus[i].now].down >= 0)
+            cpus[i].scaling_table[cpus[i].now].down >= 0 && (p_min_freq == -1 ||
+            cpus[i].scaling_table[cpus[i].now + 1].speed >= p_min_freq))
       change_speed(-1, i);
-         else if (max > speed_up && cpus[i].scaling_table[cpus[i].now].up<0)
+         else if (max > speed_up && cpus[i].scaling_table[cpus[i].now].up<0 &&
+             (p_max_freq == -1 ||
+             cpus[i].scaling_table[cpus[i].now - 1].speed <= p_max_freq))
       change_speed(1, i);
-         else if (max < speed_down && cpus[i].scaling_table[cpus[i].now].down<0)
+         else if (max < speed_down && cpus[i].scaling_table[cpus[i].now].down<0 &&
+             (p_min_freq == -1 ||
+             cpus[i].scaling_table[cpus[i].now + 1].speed >= p_min_freq))
       change_speed(-1, i);
        }
    }
@@ -1119,9 +1133,11 @@
   printf("                            increase the cpu frequency\n");
   printf("    -D, --down ARG          set ARG to be the default percentage of use to\n");
   printf("                            decrease the cpu frequency\n");
-  printf("    -V, --voltage ARG1 ARG2 set ARG2 as the new VID, expressed as a decimal value\n");
-  printf("                            for physical CPU number ARG1\n");
-  printf("    -F, --freq ARG1 ARG2    set ARG2 as the new frequency, expressed in Mhz\n");
+  printf("    -M, --max_freq ARG      set the maximum frequency to ARG, expressed in KHz\n");
+  printf("    -m, --min_freq ARG      set the minimum frequency to ARG, expressed in KHz\n");
+  printf("    -V, --voltage ARG1 ARG2 set ARG2 as the new VID, expressed as a decimal\n");
+  printf("                            value for physical CPU number ARG1\n");
+  printf("    -F, --freq ARG1 ARG2    set ARG2 as the new frequency, expressed in KHz\n");
   printf("                            for physical CPU number ARG1\n");
   printf("    -l, --laptop            activate the laptop mode check\n");
   printf("    -C, --changevid ARG     increase the VID in ARG for all speed steps. ARG can\n");
@@ -1181,6 +1197,24 @@
       else if(strcmp(argv[i],"-l")==0 || strcmp(argv[i],"--laptop")==0)
    p_laptop = 1;
 
+      else if(strcmp(argv[i],"-m")==0 || strcmp(argv[i],"--min_freq")==0)
+   {
+     i++;
+     if(i>=argc)
+       return -9;
+     p_min_freq = atoi(argv[i]);
+   }
+
+      else if(strcmp(argv[i],"-M")==0 || strcmp(argv[i],"--max_freq")==0)
+   {
+     i++;
+     if(i>=argc)
+       return -9;
+     p_max_freq = atoi(argv[i]);
+          if(p_max_freq < p_min_freq)
+       return -9;
+   }
+
       else if(strcmp(argv[i],"-a")==0 || strcmp(argv[i],"--autoconfig")==0)
    {
      p_autoconfig = 1;
@@ -1324,6 +1358,9 @@
    case -8:
      printf("bad values for governor arguments\n");
      break;
+        case -9:
+          printf("bad frequency bound\n");
+          break;
    }
       return -1;
     }

The new syntax is included in the -h/--help output. It should work for multiple processors, although the bound is set to the same value for all of them.

Elmo234: You may of course include this in the official source if you find it to be useful.

[edit]Forgot to mention that my patch also includes two fixes to the original --help output:
1) -F takes the frequency in KHz, not MHz, and
2) -V had a line that was longer than 80 columns, which made the output ugly.[/edit]
_________________
I have to return some videotapes
Back to top
View user's profile Send private message
/carlito
Guru
Guru


Joined: 31 Dec 2004
Posts: 450
Location: Belgium

PostPosted: Thu Jun 08, 2006 3:32 pm    Post subject: Reply with quote

I really can't understand this program. I own an MSI megabook S270 which hosts a Turion MT30 cpu.
Code:
# cpupw -s
readmsr, in read: Invalid argument
readmsr, in read: Invalid argument
System has 1 physical CPUs and 1 logial CPUs
readmsr, in read: Invalid argument
CPU 0-> voltage: 1.350000 v, VID: 8, frequency: 1200 Mhz, FID: 4
        Theorical bus speed: 19.000000
        Real bus speed: 100.000000
readmsr, in read: Invalid argument
        Real cpu speed: 5500.000000
        Governor: userspace


Code:
# cpupw -a
readmsr, in read: Invalid argument
readmsr, in read: Invalid argument
1
1
304
2
800000 -1 -1 -1
1600000 -1 -1 -1
1


Can someone assist me on how to test and set my VID?
_________________

.O.
..O
OOO
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum