Discussion:
CPU power consumption on thinkpad x201 on openbsd current
Johan Svensson
2014-06-04 21:08:42 UTC
Permalink
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
STeve Andre'
2014-06-04 22:53:30 UTC
Permalink
Post by 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
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'
Johan Svensson
2014-06-05 08:53:38 UTC
Permalink
Post by STeve Andre'
Post by 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
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
STeve Andre'
2014-06-05 09:00:15 UTC
Permalink
Post by Johan Svensson
Post by STeve Andre'
Post by 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
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'
# 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)
# 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'
David Coppa
2014-06-05 09:09:50 UTC
Permalink
Post by Johan Svensson
# 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)
# 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?
Johan Svensson
2014-06-05 09:25:46 UTC
Permalink
Post by David Coppa
Post by Johan Svensson
# 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)
# 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.
Mike Larkin
2014-06-05 18:43:41 UTC
Permalink
Post by Johan Svensson
Post by STeve Andre'
Post by 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
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'
# 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)
# 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.
Johan Svensson
2014-06-05 21:23:44 UTC
Permalink
Post by Mike Larkin
Post by Johan Svensson
Post by STeve Andre'
Post by 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
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'
# 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)
# 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
Stefan Sperling
2014-12-12 16:33:40 UTC
Permalink
Post by 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
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.

Loading...