# kernel 2.6.2 + laptop_mode ?  (no love patch!!)

## sethleon

hi all,

I have downloaded, configed and compiled the stable 2.6.2 kernel

from kernel.org .

All works fine, (in my gentoo)

except the normal battery mode,

as I still were in windows the battery had energy for 2 hours.

When I now plug out AC it only has 33 till 45 minutes   :Sad: 

So I search the gentoo forum, and found that script share

concerning a kernel patched with "laptop_mode".

So that sounds good to me that stuff of saving energy using this script!

But I did not find any "laptop_mode" patch for the normal 2.6.2 kernel,...

can anyone please help me, I just want at least 90 minutes battery time,

does anyone know another way to do this ?

BTW - my system: KDE 3.2 on a Gentoo unix with kernel 2.6.2 (stable version from kernel.org) already patched with acpi patch of acpi.sourceforge.net

hardware: Intel P4 2,4 GHz; 512 DDR-RAM; NVIDIA GeForce FX GO6500 (64MB) on a Gericom Hummer FX 5600 Laptop

----------

## steveb

i can not resist! *sethleon wrote:*   

> BTW - my system: KDE 3.2 on a Gentoo unix with kernel 2.6.2 (stable version from kernel.org) already patched with acpi patch of acpi.sourceforge.net
> 
> hardware: Intel P4 2,4 GHz; 512 DDR-RAM; NVIDIA GeForce FX GO6500 (64MB) on a Gericum Hummer FX 5600 Laptop

 sweet  :Wink:  Gentoo unix? it is Gentoo Linux.

anyway... i used google to search for laptop_mode and found this link: http://marc.theaimsgroup.com/?l=linux-kernel&m=107373132824121&w=2

cheers

SteveB

----------

## altorus

Are you sure you actually have a mobility chip? Ie one that can do voltage asjustments and thus have different speeds

If its just a desknote, you're talking a desktop cpu with no speed stepping at all.

But anyway

Roll you kernel with Cpu Frequency scaling options for your processor.  Its under general setup, Power management (i beleive)  Enable ACPI while you're there

A program like cpufreqd can just sit in the background, and drop down to a lower speed when running off of battery.  When AC is on, it will give you you full speed

Also, 2.6 has much nicer power management,. cpufreqd is a bit more legacy (and shit it may even be amd only - i know i used it but not sure what chips it can do)  A more elegant solition would be to use speedfreqd.  This can be run with the -u switch so that users can  change the cpu frequency.

Then its a simple matter of running speedfreq -p powesave, and this wil lsort out your cpu to run at a slower speed.  If you're really bored. you could prolly haclk an acpid script together to do all this automatically, but anywy

This is all asusming one thing tho - its not a desktop cpu in that lappy.  If it is, enjoy your 30 minutes  :Neutral: 

----------

## sethleon

long time ago as I still was in windows,

I made a hardware check,

it scanned all my cpu supports and also

what the rest of the hardware supports and is like.

So in that hardware scan, it said:

 *Quote:*   

> CPU type:   Mobile Intel Pentium 4A, 2400 MHz
> 
> CPU designation:  Northwood, A80532
> 
> ...
> ...

 

that's a little bit strange, because the desribtion and logo on my laptop

said: "Intel Pentium 4 2.40 GHz" and the logo "Intel Pentium 4"

----------

## sethleon

@steveb

I also search using google,

so what I need is a patch for the kernel 2.6.2,

that is what I did not found   :Sad: 

(I mean the patch about laptop_mode).

----------

## steveb

i am using the love sources (http://www.linuxmall.us/~lovepatch/love-sources/) and they include the laptop mode already:

```
thinkpad / # ls -lah /proc/sys/vm/

total 0

dr-xr-xr-x    3 root     root            0 Feb 13 10:58 .

dr-xr-xr-x   11 root     root            0 Feb 13 10:58 ..

-rw-r--r--    1 root     root            0 Feb 13 10:58 block_dump

-rw-r--r--    1 root     root            0 Feb 13 10:58 dirty_background_ratio

-rw-r--r--    1 root     root            0 Feb 13 10:58 dirty_expire_centisecs

-rw-r--r--    1 root     root            0 Feb 13 10:58 dirty_ratio

-rw-r--r--    1 root     root            0 Feb 13 10:58 dirty_writeback_centisecs

-rw-r--r--    1 root     root            0 Feb 13 10:58 laptop_mode

-rw-r--r--    1 root     root            0 Feb 13 10:58 lower_zone_protection

-rw-r--r--    1 root     root            0 Feb 13 10:58 min_free_kbytes

-rw-r--r--    1 root     root            0 Feb 13 10:58 nr_hugepages

-r--r--r--    1 root     root            0 Feb 13 10:58 nr_pdflush_threads

-rw-r--r--    1 root     root            0 Feb 13 10:58 overcommit_memory

-rw-r--r--    1 root     root            0 Feb 13 10:58 overcommit_ratio

-rw-r--r--    1 root     root            0 Feb 13 10:58 page-cluster

dr-xr-xr-x    2 root     root            0 Feb 13 10:58 pagebuf

-rw-r--r--    1 root     root            0 Feb 13 10:58 swappiness

thinkpad / # 
```

all i did, was to enable laptop specific stuff in my kernel. like speedstep and other things like this.

cheers

SteveB

----------

## sethleon

oh thanx steveb,

exactly what I need,

maybe I would never have found it   :Very Happy: 

Soon, I will patch my kernel using that lovepatch,

than also my laptop_mode should work  :Smile: 

----------

## steveb

i don't know, if this is an love patch set feature or not!

maybe the stock vanilla sources has that feature as well...

cheers

SteveB

----------

## sethleon

so,

I just patch the kernel 2.6.2 source (downloaded from kernel.org and patched with acpi)

and it worked (patching)   :Very Happy: 

I am just menuconfig'ing and already saw some additional options  :Smile: 

----------

## sethleon

now,

the only thing that makes me thinking of is,

that the Intel Pentium Logo showed no "mobile"

and that the hardware descriptions on my laptop

did not show "mobile" as well   :Confused: 

Although the hardware test I let scan in windows,

told my that my laptop's CPU type is "Mobile ... P4".

So do you know how linux can find out,

if my laptop's CPU type really is a "Mobile ... P4" ?

----------

## Aphex3K

you can 

```
cat /proc/cpuinfo
```

 to get to know something about your cpu. don't know if something of mobility would be mentioned there, i never did that on a mobility cpu. but you could try at least.

----------

## sethleon

so this is printed out:

```
bash-2.05b$ cat /proc/cpuinfo

processor       : 0

vendor_id       : GenuineIntel

cpu family      : 15

model           : 2

model name      : Genuine Intel(R) CPU 2.40GHz

stepping        : 9

cpu MHz         : 2399.069

cache size      : 512 KB

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 2

wp              : yes

flags           : fpu vme de tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid

bogomips        : 4734.97

```

so nothing about "Mobile Intel Pentium 4", maybe the "mobile" is a flag, 

I just don't know all flags, maybe one is hinting that my laptop's CPU is mobile like !

----------

## pilla

Mine looks like that

```

model name      : Intel(R) Pentium(R) III Mobile CPU      1200MHz

```

Are you sure your laptop has a mobile chip? Some of the cheaper laptops just bundle a regular (and power-hungry) desktop chip to save (on money).

----------

## sethleon

I'm not sure, that why I am asking,

because a hardware scan program for windows (AIDA)

found out that my laptop's CPU is "Mobile Intel Pentium 4A",

later in the scan it said "CPUID CPU NAME: Genuin Intel(R) CPU 2.40GHz".

That why I'm not sure.

----------

## Aphex3K

 *sethleon wrote:*   

> so this is printed out:
> 
> flags           : fpu vme de tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid
> 
> 

 

Im not sure about this but isn't ACPI something about power management? So it might have some power saving function...

when did you buy your laptop? does the homepage of the vendor (you say Gericum?) not have any information about it?

----------

## sethleon

I have bought it in september or october of the last year,

sorry i mis-wrote the producer name,

the correct is Gericom,

anyway at their homepage they only have newer laptops as offers  :Sad: 

----------

## sethleon

now,

after i patched the 2.6.2 kernel to 2.6.2-love1

a strange kernel panic occurs at boot:   :Crying or Very sad: 

```
kernel BUG at mm/slab.c:1107!

invalid operand: 0000 [#1]

DEBUG_PAGEALLOC

CPU: 0

EIP: 0060:[<c0154f25>] Not tainted VLI

EFLAGS: 00010206

EIP is at kmem_cache_create+0x45/0x670

eax: c0540000 ebx: c049e740 ecx: 00000014 edx:00000020

esi: c049e800 edi: c0107000 edp: c0531f9c esp: c0531f80

ds: 007b es: 007b ss: 0068

Process swapper (pid: 0, threadinfo=c0530000 task=c0498b40)

Stack: c0566530 00000003  .........some more stack numbers.......

Call Trace:

[<c0107000>] _stext+0x0/0xd0

[<c0543208>] kmem_cache_init+0x268/0x2d0

[<c053274a>] start_kernel+0x15a/0x260

Code: 00 ff ff 00 75 ..... some more code hex values......

<0>Kernel panic: Fatal exception in interrupt

In interrupt handler - not syncing
```

pls I need help now,

I just want to deactivate the option for this panic but i can't find it .

----------

## sethleon

so btw,

now I'm trying to trace that panic in that slab.c source file,

maybe some comments of the author(s) do help ...

but I'm not sure if it helps   :Sad: 

----------

## sethleon

OK I have traced the panic to the line 1107 of the file /usr/src/linux/mm/slab.c !

so it is a BUG report (sub-process) which was accessed in the sub-process "kmem_cache_creat",

 which creats a cache (infos about this process are in a comment of the author)

maybe i can just do something about it and fix it,

fortunately i had read a tutorial about C in past,

but i don't really know if that helps, 

if anyone knows another way to fix this kernel panic, pls tell me !

BTW: I have booted from the live cd and mounted all needed partitions.

----------

## sethleon

ok,

I had used the kernel 2.6.2 without the love-patch again and it worked without kernel panics.

I gotta use speedfreq and power profiles.

----------

## sethleon

Now I think I do not have a mobile pentium  :Sad: 

some weeks ago I just tried speedfreq(d) and cpufreqd (or spelled similar)

anyway it did not help, so I gotta let A/C in and use it all time possible,

... stupid Desktop CPU ... I think it is rather than a mobile

----------

## steveb

can you post the output of:

```
cat /proc/acpi/processor/CPU/*
```

cheers

SteveB

----------

## sethleon

here's the output:

```
[***@*** ~]$ cat /proc/acpi/processor/CPU1/*

processor id:            0

acpi id:                 1

bus mastering control:   yes

power management:        no

throttling control:      no

limit interface:         no

<not supported>

active state:            C1

default state:           C1

bus master activity:     00000000

states:

   *C1:                  promotion[--] demotion[--] latency[000] usage[00000000]

    C2:                  <not supported>

    C3:                  <not supported>

<not supported>

```

I just remembered that this was the information files convincing me that i do not really have a mobile pentium   :Confused: 

anyway my notebook had the best quality in hardware for its price  :Smile: 

----------

## steveb

well.... i get the following from my notebook:

```
# cat /proc/acpi/processor/CPU*/*

processor id:            0

acpi id:                 1

bus mastering control:   yes

power management:        yes

throttling control:      yes

limit interface:         yes

active limit:            P0:T0

user limit:              P0:T0

thermal limit:           P0:T0

active state:            C2

default state:           C1

bus master activity:     fffffbff

states:

    C1:                  promotion[C2] demotion[--] latency[000] usage[03612850]

   *C2:                  promotion[C3] demotion[C1] latency[001] usage[04215799]

    C3:                  promotion[--] demotion[C2] latency[065] usage[02986622]

state count:             8

active state:            T0

states:

   *T0:                  00%

    T1:                  12%

    T2:                  25%

    T3:                  37%

    T4:                  50%

    T5:                  62%

    T6:                  75%

    T7:                  87%

```

 *sethleon wrote:*   

> anyway my notebook had the best quality in hardware for its price 

 you don't have an notebook, it is just an normal desktop in an notebook case  :Wink: 

probably it is heavy as hell and noisy, but you probably don't care  :Wink: 

cheers

SteveB

----------

## sethleon

LOL, ya partly you are right.  :Wink: 

Anyway it was the best choice, in its price category of 1200 Euro ?   :Wink: 

----------

## steveb

 *sethleon wrote:*   

> LOL, ya partly you are right. 
> 
> Anyway it was the best choice, in its price category of 1200 Euro ?  

 for 1'200 TEuro you get alot of good notebooks. but maybe i don't count, because i have reseller prices  :Wink: 

cheers / Gruss

SteveB

----------

## sethleon

In my area there was no better notebook at this time  :Wink: 

especially others had lame chipsets.  :Wink: 

Anyway, what matters is that I have a powerfull notebook.  :Wink: 

(not caring about powersaving)

----------

## steveb

easy. i think you sure have an powerfull system over there and as long as you are happy, everything is okay.

cheers

SteveB

----------

## sethleon

See, that's it, I'm happy with it.   :Very Happy: 

Despite not having any powersaving features, it's extremely useful,

e.g. now I'm making a short animation in art lesson (with blender),

while the other students are making a sculpture.

So my notebook's NVIDIA chip does very good work in rendering,...   :Very Happy: 

just as I said, I'm happy with it.  :Smile: 

----------

