# Laptop runs slower on batteries

## gmichels

Hi all

I am wondering why my laptop is extremely slower when running on batteries. When I plug in the ac adapter, there's a huge difference in boot time, desktop response, application load time, compile time, etc. I would say the difference is almost 50%.

My laptop is an HP ze4430us, AMD2400+, 512 DDR266, running love-sources 2.6.5-r5. I am using cpufreq to help cool down things a bit and also save battery life.

I first thought it was something related to cpudynd, but even disabling it completely makes no difference.

Anyone with similar experiences?

----------

## Angrybob

maybe your laptop automatically lowers the cpu speed based on the power source

----------

## gmichels

Maybe, but /proc/cpuinfo shows the cpu max speed when running on batteries.

----------

## Safrax

 *gmichels wrote:*   

> Maybe, but /proc/cpuinfo shows the cpu max speed when running on batteries.

 

/proc/cpuinfo will never update.  You will need to look in /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed or scaling_governor.  Setspeed will have the actual cpu frequency at that moment.  Governor will have which governor is currently controlling cpuspeed.  If governor has powersave, the cpu is operating at the lowest speed.  If governor has performance it is operating at the fastest speed.

----------

## gmichels

I don't have any scaling_setspeed there. Here's what I have:

```
gmichels@gustavo cpufreq $ ls

cpuinfo_max_freq               scaling_available_governors  scaling_max_freq

cpuinfo_min_freq               scaling_driver               scaling_min_freq

scaling_available_frequencies  scaling_governor

gmichels@gustavo cpufreq $ cat cpuinfo_max_freq

1795500

gmichels@gustavo cpufreq $ cat cpuinfo_min_freq

532000

gmichels@gustavo cpufreq $ cat scaling_available_frequencies

532000 665000 798000 931000 1330000 1795500

gmichels@gustavo cpufreq $ cat scaling_available_governors

powersave userspace performance

gmichels@gustavo cpufreq $ cat scaling_driver

powernow-k7

gmichels@gustavo cpufreq $ cat scaling_max_freq

1795500

gmichels@gustavo cpufreq $ cat scaling_min_freq

532000
```

The scaling_governor setting (powersave or performance) depends on what I am doing at the moment I check it.

My kernel options:

```
 [*] CPU Frequency scaling                                        

 < >   /proc/cpufreq interface (deprecated)                       

         Default CPUFreq governor (performance)  --->               

 ---   'performance' governor                                     

 <*>   'powersave' governor                                       

 <*>   'userspace' governor for userspace frequency scaling       

 [ ]     /proc/sys/cpu/ interface (2.4. / OLD)                    

 <*>   CPU frequency table helpers
```

----------

## allucid

check the BIOS to see what is setup for automatic scaling depending on the powersource.

----------

## gmichels

No good, there aren't any power management options in the bios.

I should ask HP but at the moment I say I am using linux I get that "unsupported OS, we can't help you there" response.

----------

## int2str

gmichels.

I have a Compaq Presario 2100Z notebook (very similar to yours) and have exactly the same problem. 

I've posted about it to the Linux Kernel mailing list, here's the only response I got so far:

 *Quote:*   

> Hi!
> 
> >> My notebook [1], powered by a AMD Athlon XP2400+ (k7) is slowing down when 
> 
> >> running on battery. This happens regardless of whether or not cpu frequency 
> ...

 

I do think you should call HP tech support about it. If they ask about the OS, just say WinXP or whatever came with your notebook. Because I've tried it (had to re-install XP  :Sad:  ) and it's exactly the same in XP. And there is no option to change it.

Cheers,

   André

----------

## gmichels

Ok, I will try hp's technical support and come back with whatever they say about it.

Thanks for the input, I thought I was the only "lucky" one to have this problem.

----------

## Odin

 *Safrax wrote:*   

>  *gmichels wrote:*   Maybe, but /proc/cpuinfo shows the cpu max speed when running on batteries. 
> 
> /proc/cpuinfo will never update.  You will need to look in /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed or scaling_governor.  Setspeed will have the actual cpu frequency at that moment.  Governor will have which governor is currently controlling cpuspeed.  If governor has powersave, the cpu is operating at the lowest speed.  If governor has performance it is operating at the fastest speed.

 

Not true.. mine updates, on an AthlonXP-M.

----------

## gmichels

Mine updates too.

```
$ cat /proc/cpuinfo

processor       : 0

vendor_id       : AuthenticAMD

cpu family      : 6

model           : 10

model name      : mobile AMD Athlon(tm) XP2400+

stepping        : 0

cpu MHz         : 530.099

cache size      : 512 KB

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 1

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mp mmxext 3dnowext 3dnow

bogomips        : 1048.57
```

Do you know what's worse? I was transferring a 350 mb file from a nfs server here (100 mb hub - half duplex). While running on batteries, the maximum transfer rate was around 2.4 mb/sec. Plugged in the ac adapter and the transfer speed went up to 8 mb/sec.

I really must find a solution to this.

----------

## gmichels

It really is something related to the bios. Take a look at this url.

Let's hope HP solves this in future bios releases.

----------

## int2str

gmichels, all,

I found the (a) solution to the problem (at least for my notebook)! Tonight I finally decided to work on these issues a little bit again and try to come up with better way to suspend, etc. So I resumed my quest into ACPI land.

Here's what I did to get rid of the annoying slowdown:

1) Follow this great HOWTO to compile and fix your own ACPI DSDT:

https://forums.gentoo.org/viewtopic.php?t=122145

2) On line 3544 in my dsdt code, in the SMSL method there is a line which reads simply: 

```
If (0x01)
```

There were only two such lines in my DSDT, and only one was in SMSL, so you should find it there.

3) Change that line to read: 

```
If (0x00)
```

This simply disables a small piece of code (4 lines - 2 of which are debug), which sets the "Throttle Duty Cycle".

Recompile your DSDT, put it in your initrd or kernel (I use initrd), reboot and voilá... No more slowdown.

I posted this also to the ACPI mailing list to have the experts there look at it. If they think its ok, I'll make a nicer howto. In the meantime, post here if you need more info, or better yet, if it worked for you!

 :Smile: 

----------

## gmichels

Dude I am gonna try this right now, I don't run on batteries anymore just because of this.

Just being safe, which notebook model do you own?

----------

## int2str

A Compaq Presario 2100Z

AMD Athlon XP 2400+

ALi Chipset

ATI Radeon Mobile (IGP 320)

I have another update actually:

As I said, there is two "If (0x01)" lines in there. Change them both actually. The handles the switch from AC->Battery, the other handles when you start out on battery.

----------

## cwt137

I still use the other OS alot. Will this patch mess up the DSDT in the other OS?

----------

## gmichels

int2str

The "If (0x01)" lines weren't at the same places as yours, but there were two and I changed them both. I still get 2 errors in the DSDT compilation, though the original DSDT file had these 2 errors also.

Do you use 2.6? I am having some trouble patching the kernel (mine is 2.6.6-love4) and I don't use initrd.

----------

## int2str

cwt:

No, it only works while in Gentoo since it overwrite the DSDT only temporarily after the kernel is loaded. You reboot and it's back to rom.

michels:

Yes, the lines dont have to be in the same place (should be the same functions though). What errors do you get?

I am using 2.6.7-rc1-mm1 with an older initrd patch.

Cheers,

   Andre

----------

## gmichels

I have asked also on the howto thread, but here's the post:

```
# patch -Np1 --dry-run < /root/ze4430us/acpi/dsdt_override.patch

patching file drivers/acpi/osl.c

Hunk #2 FAILED at 209.

1 out of 2 hunks FAILED -- saving rejects to file drivers/acpi/osl.c.rej
```

My osl.c has the following significant part (I guess):

```
acpi_os_table_override (struct acpi_table_header *existing_table,

                        struct acpi_table_header **new_table)

{

        if (!existing_table || !new_table)

                return AE_BAD_PARAMETER;

#ifdef CONFIG_ACPI_INITRD

        if (!memcmp(existing_table, "DSDT", 4) && (dsdt_start != NULL)) {

                printk(KERN_INFO "ACPI: Using customized DSDT\n");

                *new_table = (struct acpi_table_header*)dsdt_start;

        } else

#endif

                *new_table = NULL;

        return AE_OK;

}
```

Maybe there's a new version of the override patch, as I am using the one listed in the first page of that thread. Do you know what is the bug number for that attachment?

----------

## int2str

I am using this patch (remember, its initrd):

http://gaugusch.at/acpi-dsdt-initrd-patches/acpi-dsdt-initrd-patch-v0.5-2.6.5-eric.patch

Applies cleanly even against 2.6.7-rc1-mm1

Cheers,

   André

----------

## cwt137

 *gmichels wrote:*   

> It really is something related to the bios. Take a look at this url.
> 
> Let's hope HP solves this in future bios releases.

 

I hope they fix this stupid bug and the PST table bug i have on my compaq presario 2100 series notebook.

----------

## Legoguy

See https://forums.gentoo.org/viewtopic.php?p=1187367#1187367

(don't want to duplicate posts in 2 threads)

----------

## cwt137

Thanks Legoguy, just upgraded my laptop to the latest bios and the slow laptop bug went away, no editing the dsdt. Just the pst problem but there is a fix in kernel 2.6.6 .

----------

## int2str

Whats the ROM version?

There is no new ROM for my notebook.

----------

## brodo

 *gmichels wrote:*   

> Mine updates too.
> 
> ```
> $ cat /proc/cpuinfo
> 
> ...

 

It updates if you're running an UP kernel. On 2.7., it will _never_ update.

----------

## gmichels

It worked! Now I can use my laptop on batteries without slowdowns. Yay!

Thanks a lot for the guidelines, int2str.

----------

## kurtb

I have a HP ZE4125 laptop that exhibited the exact same problems.  Basically, when I would unplug the power and run on batteries the cpu would just spike not doing much of anything.  When I plugged it back in it was normal again.  So I took int2str's advice and hacked at my bios and now all is well.  The problem no longer exists so it is definitely an HP bios issue.

----------

