Re: CPU power consumption on thinkpad x201 on openbsd current

2014-12-12 Thread Stefan Sperling
On Wed, Jun 04, 2014 at 11:08:42PM +0200, Johan Svensson wrote:
> I'm trying to migrate from Linux to Openbsd on my laptop (thinkpad x201).
> 
> The first problem that i came across was that the Cpu fanspeed was running
> constantly at 3500RPM.
> After the acpithinkpad.c patch from jcs (and i modified to make it work on
> the openbsd-current(link: http://exclude.se/patch/jcs_mod_by_js.diff)
> 
> Another thing that i noticed is that the battery lifetime is really bad.
> In Linux i get around ~5,5 hours.
> In OpenBSD i get around 2 hours.
> 
> when i ran : sysctl hw.sensors | grep -i consumption.
> the output of the cpu was 6W.
> 
> in Linux it's around 1,5W.
> 
> with: apmd -C and apmd -L it's the same.
> dmesg: http://exclude.se/openbsd/dmesg.txt
> 
> Is there anyway to fix this?
> 
> Regards
> Johan Svensson

I've done some testing on an x201i and it seems the intel_powerclamp driver
("Package Level C-state Idle Injection for Intel CPUs") is responsible for
the difference in battery life. If that Linux driver is blacklisted battery
life drops to about the same levels as on OpenBSD.



Re: CPU power consumption on thinkpad x201 on openbsd current

2014-06-05 Thread Johan Svensson

On 2014-06-05 20:43, Mike Larkin wrote:

On Thu, Jun 05, 2014 at 10:53:38AM +0200, Johan Svensson wrote:

On 06/05/14 00:53, STeve Andre' wrote:

On 06/04/14 17:08, Johan Svensson wrote:

I'm trying to migrate from Linux to Openbsd on my laptop
(thinkpad x201).

The first problem that i came across was that the Cpu fanspeed
was running constantly at 3500RPM.
After the acpithinkpad.c patch from jcs (and i modified to make
it work on the openbsd-current(link:
http://exclude.se/patch/jcs_mod_by_js.diff)

Another thing that i noticed is that the battery lifetime is really bad.
In Linux i get around ~5,5 hours.
In OpenBSD i get around 2 hours.

when i ran : sysctl hw.sensors | grep -i consumption.
the output of the cpu was 6W.

in Linux it's around 1,5W.

with: apmd -C and apmd -L it's the same.
dmesg: http://exclude.se/openbsd/dmesg.txt

Is there anyway to fix this?

Regards
Johan Svensson



Take a look at hw.setperf in sysctl.  I think you are running at the
maximum cpu speed?  On my 2.8GHz W500 I can run at 800, 1600,
2133 and 2801.  800MHz makes a huge difference.  You have to
try different values for setperf to see what happens.  sysctl will
also tell you the speed in hw.cpuspeed.

--STeve Andre'

This my output from sysctl and apm when running on the lowest clockspeed:
# sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption"
hw.sensors.acpithinkpad0.fan0=1959 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=1199
hw.setperf=0
# apm
Battery state: high, 70% remaining, 111 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (1199 MHz)


This is the output when i use apm -H:
# sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption"
hw.sensors.acpithinkpad0.fan0=1972 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=2666
hw.setperf=100
# apm
Battery state: high, 68% remaining, 107 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (2666 MHz)

The energy consumption is the same which is odd.

--Johan


This may be a bug in itherm(4), I'll take a look.


Tell me if you find something, i'll gladly help if I could do something.

/J



Re: CPU power consumption on thinkpad x201 on openbsd current

2014-06-05 Thread Mike Larkin
On Thu, Jun 05, 2014 at 10:53:38AM +0200, Johan Svensson wrote:
> On 06/05/14 00:53, STeve Andre' wrote:
> >On 06/04/14 17:08, Johan Svensson wrote:
> >>I'm trying to migrate from Linux to Openbsd on my laptop
> >>(thinkpad x201).
> >>
> >>The first problem that i came across was that the Cpu fanspeed
> >>was running constantly at 3500RPM.
> >>After the acpithinkpad.c patch from jcs (and i modified to make
> >>it work on the openbsd-current(link:
> >>http://exclude.se/patch/jcs_mod_by_js.diff)
> >>
> >>Another thing that i noticed is that the battery lifetime is really bad.
> >>In Linux i get around ~5,5 hours.
> >>In OpenBSD i get around 2 hours.
> >>
> >>when i ran : sysctl hw.sensors | grep -i consumption.
> >>the output of the cpu was 6W.
> >>
> >>in Linux it's around 1,5W.
> >>
> >>with: apmd -C and apmd -L it's the same.
> >>dmesg: http://exclude.se/openbsd/dmesg.txt
> >>
> >>Is there anyway to fix this?
> >>
> >>Regards
> >>Johan Svensson
> >>
> >>
> >Take a look at hw.setperf in sysctl.  I think you are running at the
> >maximum cpu speed?  On my 2.8GHz W500 I can run at 800, 1600,
> >2133 and 2801.  800MHz makes a huge difference.  You have to
> >try different values for setperf to see what happens.  sysctl will
> >also tell you the speed in hw.cpuspeed.
> >
> >--STeve Andre'
> This my output from sysctl and apm when running on the lowest clockspeed:
> # sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption"
> hw.sensors.acpithinkpad0.fan0=1959 RPM
> hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
> hw.cpuspeed=1199
> hw.setperf=0
> # apm
> Battery state: high, 70% remaining, 111 minutes life estimate
> A/C adapter state: not connected
> Performance adjustment mode: manual (1199 MHz)
> 
> 
> This is the output when i use apm -H:
> # sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption"
> hw.sensors.acpithinkpad0.fan0=1972 RPM
> hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
> hw.cpuspeed=2666
> hw.setperf=100
> # apm
> Battery state: high, 68% remaining, 107 minutes life estimate
> A/C adapter state: not connected
> Performance adjustment mode: manual (2666 MHz)
> 
> The energy consumption is the same which is odd.
> 
> --Johan
> 

This may be a bug in itherm(4), I'll take a look.



Re: CPU power consumption on thinkpad x201 on openbsd current

2014-06-05 Thread Johan Svensson

On 2014-06-05 11:09, David Coppa wrote:

On Thu, Jun 5, 2014 at 10:53 AM, Johan Svensson  wrote:


This my output from sysctl and apm when running on the lowest clockspeed:
# sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption"
hw.sensors.acpithinkpad0.fan0=1959 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=1199
hw.setperf=0
# apm
Battery state: high, 70% remaining, 111 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (1199 MHz)


This is the output when i use apm -H:
# sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption"
hw.sensors.acpithinkpad0.fan0=1972 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=2666
hw.setperf=100
# apm
Battery state: high, 68% remaining, 107 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (2666 MHz)

The energy consumption is the same which is odd.

Are you running with the latest bios (1.40-1.15) from Lenovo?

Yes it is the latest bios.


Hmmm.  Smells like a bug, to me.  But by changing hw.setperf your
self you should be able to go to other speeds(?).  And of course, the
real test is to see if you get longer life at setperf 0.

--STeve Andre'

# sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption" && apm
hw.sensors.acpithinkpad0.fan0=1965 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=1199
hw.setperf=0
Battery state: high, 57% remaining, 91 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (1199 MHz)
#

It seems like that's the same output. If the processor throttles down it 
should also consume less energy, but it says 6W all the time though.




Re: CPU power consumption on thinkpad x201 on openbsd current

2014-06-05 Thread David Coppa
On Thu, Jun 5, 2014 at 10:53 AM, Johan Svensson  wrote:

> This my output from sysctl and apm when running on the lowest clockspeed:
> # sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption"
> hw.sensors.acpithinkpad0.fan0=1959 RPM
> hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
> hw.cpuspeed=1199
> hw.setperf=0
> # apm
> Battery state: high, 70% remaining, 111 minutes life estimate
> A/C adapter state: not connected
> Performance adjustment mode: manual (1199 MHz)
>
>
> This is the output when i use apm -H:
> # sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption"
> hw.sensors.acpithinkpad0.fan0=1972 RPM
> hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
> hw.cpuspeed=2666
> hw.setperf=100
> # apm
> Battery state: high, 68% remaining, 107 minutes life estimate
> A/C adapter state: not connected
> Performance adjustment mode: manual (2666 MHz)
>
> The energy consumption is the same which is odd.

Are you running with the latest bios (1.40-1.15) from Lenovo?



Re: CPU power consumption on thinkpad x201 on openbsd current

2014-06-05 Thread STeve Andre'

On 06/05/14 04:53, Johan Svensson wrote:


On 06/05/14 00:53, STeve Andre' wrote:

On 06/04/14 17:08, Johan Svensson wrote:
I'm trying to migrate from Linux to Openbsd on my laptop (thinkpad 
x201).


The first problem that i came across was that the Cpu fanspeed was 
running constantly at 3500RPM.
After the acpithinkpad.c patch from jcs (and i modified to make it 
work on the openbsd-current(link: 
http://exclude.se/patch/jcs_mod_by_js.diff)


Another thing that i noticed is that the battery lifetime is really 
bad.

In Linux i get around ~5,5 hours.
In OpenBSD i get around 2 hours.

when i ran : sysctl hw.sensors | grep -i consumption.
the output of the cpu was 6W.

in Linux it's around 1,5W.

with: apmd -C and apmd -L it's the same.
dmesg: http://exclude.se/openbsd/dmesg.txt

Is there anyway to fix this?

Regards
Johan Svensson



Take a look at hw.setperf in sysctl.  I think you are running at the
maximum cpu speed?  On my 2.8GHz W500 I can run at 800, 1600,
2133 and 2801.  800MHz makes a huge difference.  You have to
try different values for setperf to see what happens.  sysctl will
also tell you the speed in hw.cpuspeed.

--STeve Andre'

This my output from sysctl and apm when running on the lowest clockspeed:
# sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption"
hw.sensors.acpithinkpad0.fan0=1959 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=1199
hw.setperf=0
# apm
Battery state: high, 70% remaining, 111 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (1199 MHz)


This is the output when i use apm -H:
# sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption"
hw.sensors.acpithinkpad0.fan0=1972 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=2666
hw.setperf=100
# apm
Battery state: high, 68% remaining, 107 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (2666 MHz)

The energy consumption is the same which is odd.

--Johan


Hmmm.  Smells like a bug, to me.  But by changing hw.setperf your
self you should be able to go to other speeds(?).  And of course, the
real test is to see if you get longer life at setperf 0.

--STeve Andre'



Re: CPU power consumption on thinkpad x201 on openbsd current

2014-06-05 Thread Johan Svensson

On 06/05/14 00:53, STeve Andre' wrote:

On 06/04/14 17:08, Johan Svensson wrote:
I'm trying to migrate from Linux to Openbsd on my laptop (thinkpad 
x201).


The first problem that i came across was that the Cpu fanspeed was 
running constantly at 3500RPM.
After the acpithinkpad.c patch from jcs (and i modified to make it 
work on the openbsd-current(link: 
http://exclude.se/patch/jcs_mod_by_js.diff)


Another thing that i noticed is that the battery lifetime is really bad.
In Linux i get around ~5,5 hours.
In OpenBSD i get around 2 hours.

when i ran : sysctl hw.sensors | grep -i consumption.
the output of the cpu was 6W.

in Linux it's around 1,5W.

with: apmd -C and apmd -L it's the same.
dmesg: http://exclude.se/openbsd/dmesg.txt

Is there anyway to fix this?

Regards
Johan Svensson



Take a look at hw.setperf in sysctl.  I think you are running at the
maximum cpu speed?  On my 2.8GHz W500 I can run at 800, 1600,
2133 and 2801.  800MHz makes a huge difference.  You have to
try different values for setperf to see what happens.  sysctl will
also tell you the speed in hw.cpuspeed.

--STeve Andre'

This my output from sysctl and apm when running on the lowest clockspeed:
# sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption"
hw.sensors.acpithinkpad0.fan0=1959 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=1199
hw.setperf=0
# apm
Battery state: high, 70% remaining, 111 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (1199 MHz)


This is the output when i use apm -H:
# sysctl hw | grep -iE "cpuspeed|setperf|fan|consumption"
hw.sensors.acpithinkpad0.fan0=1972 RPM
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.cpuspeed=2666
hw.setperf=100
# apm
Battery state: high, 68% remaining, 107 minutes life estimate
A/C adapter state: not connected
Performance adjustment mode: manual (2666 MHz)

The energy consumption is the same which is odd.

--Johan



Re: CPU power consumption on thinkpad x201 on openbsd current

2014-06-04 Thread STeve Andre'

On 06/04/14 17:08, Johan Svensson wrote:

I'm trying to migrate from Linux to Openbsd on my laptop (thinkpad x201).

The first problem that i came across was that the Cpu fanspeed was 
running constantly at 3500RPM.
After the acpithinkpad.c patch from jcs (and i modified to make it 
work on the openbsd-current(link: 
http://exclude.se/patch/jcs_mod_by_js.diff)


Another thing that i noticed is that the battery lifetime is really bad.
In Linux i get around ~5,5 hours.
In OpenBSD i get around 2 hours.

when i ran : sysctl hw.sensors | grep -i consumption.
the output of the cpu was 6W.

in Linux it's around 1,5W.

with: apmd -C and apmd -L it's the same.
dmesg: http://exclude.se/openbsd/dmesg.txt

Is there anyway to fix this?

Regards
Johan Svensson



Take a look at hw.setperf in sysctl.  I think you are running at the
maximum cpu speed?  On my 2.8GHz W500 I can run at 800, 1600,
2133 and 2801.  800MHz makes a huge difference.  You have to
try different values for setperf to see what happens.  sysctl will
also tell you the speed in hw.cpuspeed.

--STeve Andre'



CPU power consumption on thinkpad x201 on openbsd current

2014-06-04 Thread Johan Svensson

I'm trying to migrate from Linux to Openbsd on my laptop (thinkpad x201).

The first problem that i came across was that the Cpu fanspeed was 
running constantly at 3500RPM.
After the acpithinkpad.c patch from jcs (and i modified to make it work 
on the openbsd-current(link: http://exclude.se/patch/jcs_mod_by_js.diff)


Another thing that i noticed is that the battery lifetime is really bad.
In Linux i get around ~5,5 hours.
In OpenBSD i get around 2 hours.

when i ran : sysctl hw.sensors | grep -i consumption.
the output of the cpu was 6W.

in Linux it's around 1,5W.

with: apmd -C and apmd -L it's the same.
dmesg: http://exclude.se/openbsd/dmesg.txt

Is there anyway to fix this?

Regards
Johan Svensson