Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2015 16:18:33 +0200
From:      george ember <sk8harddiefast@gmail.com>
Cc:        freebsd-acpi@freebsd.org
Subject:   Re: Laptop Battery drains insanely Fast!
Message-ID:  <CAJ7d6nempJR==-2_UdJYFTU1Q1DFz-%2Bh3m4NvRhwcPKLEj6h1Q@mail.gmail.com>
In-Reply-To: <20150212192344.P38620@sola.nimnet.asn.au>
References:  <CAJ7d6nfh7DrUbFXoEV%2BzRObkEQn0dhuj8EQ8CfJtoKEfrZH=wg@mail.gmail.com> <20150212192344.P38620@sola.nimnet.asn.au>

next in thread | previous in thread | raw e-mail | index | archive | help
Ok. I made the changes.

I changed my */etc/rc.conf* from

performance_cx_lowest=3D"CMAX"
performance_cx_lowest=3D"CMAX"

to

performance_cx_lowest=3D"Cmax"
performance_cx_lowest=3D"Cmax"

and I rebooted laptop.

My
*$ tail -f /var/log/messages*
Feb 13 15:28:47 FreeBSD kernel: WARNING: attempt to domain_add(bluetooth)
after domainfinalize()
Feb 13 15:28:47 FreeBSD kernel: WARNING: attempt to domain_add(netgraph)
after domainfinalize()
Feb 13 15:28:48 FreeBSD ntpd[609]: ntpd 4.2.4p5-a (1)
Feb 13 15:28:55 FreeBSD ntpd[610]: time correction of -86382 seconds
exceeds sanity limit (1000); set clock manually to the correct UTC time.
Feb 13 15:35:08 FreeBSD devd: Executing '/etc/rc.d/power_profile 0x01'
Feb 13 15:35:08 FreeBSD power_profile: changed to 'performance'
Feb 13 15:35:12 FreeBSD devd: Executing '/etc/rc.d/power_profile 0x00'
Feb 13 15:35:12 FreeBSD power_profile: changed to 'economy'
Feb 13 15:35:16 FreeBSD devd: Executing '/etc/rc.d/power_profile 0x01'
Feb 13 15:35:16 FreeBSD power_profile: changed to 'performance'
Feb 13 15:38:06 FreeBSD devd: Executing '/etc/rc.d/power_profile 0x00'
Feb 13 15:38:06 FreeBSD power_profile: changed to 'economy'
Feb 13 15:38:09 FreeBSD devd: Executing '/etc/rc.d/power_profile 0x01'
Feb 13 15:38:09 FreeBSD power_profile: changed to 'performance'
^C

Returns from performance to economy profile when I plug / unplug the charge=
r

I restart powerd service to keep the latest values.

My *$ sysctl -a | egrep 'cx|freq_'* now changed
hw.acpi.cpu.cx_lowest: C8
dev.cpu.0.freq_levels: 2201/35000 2200/35000 2100/32872 2000/30785
1900/29079 1800/27071 1700/25435 1600/23510 1500/21943 1400/20089
1300/18589 1200/16810
dev.cpu.0.cx_supported: C1/1/1 C2/2/59 C3/3/87
dev.cpu.0.cx_lowest: C8
dev.cpu.0.cx_usage: 0.16% 0.11% 99.72% last 11934us
dev.cpu.1.cx_supported: C1/1/1 C2/2/59 C3/3/87
dev.cpu.1.cx_lowest: C8
dev.cpu.1.cx_usage: 0.07% 0.07% 99.84% last 9180us
dev.cpu.2.cx_supported: C1/1/1 C2/2/59 C3/3/87
dev.cpu.2.cx_lowest: C8
dev.cpu.2.cx_usage: 0.19% 0.12% 99.68% last 6813us
dev.cpu.3.cx_supported: C1/1/1 C2/2/59 C3/3/87
dev.cpu.3.cx_lowest: C8
dev.cpu.3.cx_usage: 0.00% 0.00% 100.00% last 12137us
dev.cpu.4.cx_supported: C1/1/1 C2/2/59 C3/3/87
dev.cpu.4.cx_lowest: C8
dev.cpu.4.cx_usage: 0.07% 0.02% 99.90% last 14us
dev.cpu.5.cx_supported: C1/1/1 C2/2/59 C3/3/87
dev.cpu.5.cx_lowest: C8
dev.cpu.5.cx_usage: 0.36% 0.23% 99.39% last 13169us
dev.cpu.6.cx_supported: C1/1/1 C2/2/59 C3/3/87
dev.cpu.6.cx_lowest: C8
dev.cpu.6.cx_usage: 0.21% 0.12% 99.65% last 10611us
dev.cpu.7.cx_supported: C1/1/1 C2/2/59 C3/3/87
dev.cpu.7.cx_lowest: C8
dev.cpu.7.cx_usage: 0.08% 0.04% 99.87% last 12465us
dev.est.0.freq_settings: 2201/35000 2200/35000 2100/32872 2000/30785
1900/29079 1800/27071 1700/25435 1600/23510 1500/21943 1400/20089
1300/18589 1200/16810
dev.est.1.freq_settings: 2201/35000 2200/35000 2100/32872 2000/30785
1900/29079 1800/27071 1700/25435 1600/23510 1500/21943 1400/20089
1300/18589 1200/16810
dev.est.2.freq_settings: 2201/35000 2200/35000 2100/32872 2000/30785
1900/29079 1800/27071 1700/25435 1600/23510 1500/21943 1400/20089
1300/18589 1200/16810
dev.est.3.freq_settings: 2201/35000 2200/35000 2100/32872 2000/30785
1900/29079 1800/27071 1700/25435 1600/23510 1500/21943 1400/20089
1300/18589 1200/16810
dev.est.4.freq_settings: 2201/35000 2200/35000 2100/32872 2000/30785
1900/29079 1800/27071 1700/25435 1600/23510 1500/21943 1400/20089
1300/18589 1200/16810
dev.est.5.freq_settings: 2201/35000 2200/35000 2100/32872 2000/30785
1900/29079 1800/27071 1700/25435 1600/23510 1500/21943 1400/20089
1300/18589 1200/16810
dev.est.6.freq_settings: 2201/35000 2200/35000 2100/32872 2000/30785
1900/29079 1800/27071 1700/25435 1600/23510 1500/21943 1400/20089
1300/18589 1200/16810
dev.est.7.freq_settings: 2201/35000 2200/35000 2100/32872 2000/30785
1900/29079 1800/27071 1700/25435 1600/23510 1500/21943 1400/20089
1300/18589 1200/16810

My *acpiconf -i0*
Design capacity:    45820 mWh
Last full capacity:    42170 mWh
Technology:        secondary (rechargeable)
Design voltage:        14400 mV
Capacity (warn):    4210 mWh
Capacity (low):        1263 mWh
Low/warn granularity:    264 mWh
Warn/full granularity:    3780 mWh
Model number:        PABAS0241231
Serial number:        41167
Type:            Li-Ion
OEM info:        LENOVO
State:            discharging
Remaining capacity:    53%
Remaining time:        2:19
Present rate:        9760 mW
Present voltage:    14362 mV

My* $ sudo sysctl hw.acpi*
hw.acpi.supported_sleep_state: S3 S4 S5
hw.acpi.power_button_state: S5
hw.acpi.sleep_button_state: S3
hw.acpi.lid_switch_state: NONE
hw.acpi.standby_state: NONE
hw.acpi.suspend_state: S3
hw.acpi.sleep_delay: 1
hw.acpi.s4bios: 0
hw.acpi.verbose: 0
hw.acpi.disable_on_reboot: 0
hw.acpi.handle_reboot: 1
hw.acpi.reset_video: 0
hw.acpi.cpu.cx_lowest: C8
hw.acpi.thermal.min_runtime: 0
hw.acpi.thermal.polling_rate: 10
hw.acpi.thermal.user_override: 0
hw.acpi.thermal.tz0.temperature: 45.0C
hw.acpi.thermal.tz0.active: -1
hw.acpi.thermal.tz0.passive_cooling: 0
hw.acpi.thermal.tz0.thermal_flags: 1
hw.acpi.thermal.tz0._PSV: 0.0C
hw.acpi.thermal.tz0._HOT: 127.0C
hw.acpi.thermal.tz0._CRT: 127.0C
hw.acpi.thermal.tz0._ACx: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
hw.acpi.thermal.tz0._TC1: 0
hw.acpi.thermal.tz0._TC2: 0
hw.acpi.thermal.tz0._TSP: 0
hw.acpi.battery.life: 49
hw.acpi.battery.time: 125
hw.acpi.battery.state: 1
hw.acpi.battery.units: 1
hw.acpi.battery.info_expire: 5
hw.acpi.acline:

Now for the script, I have a little problem

The script now:

#!/bin/sh
t=3D"     "       # a tab
echo -n "`date` "
sysctl dev.cpu.0.freq
echo "`sysctl -n dev.cpu.2.cx_usage` $t `sysctl -n vm.loadavg`"
echo "`sysctl -n dev.cpu.7.cx_usage` $t { `sysctl -n kern.eventtimer.timer`
}"
sysctl dev.acpi_ibm | egrep 'fan_|thermal'
sysctl hw.acpi.thermal.tz0.temperature
acpiconf -i0 | egrep 'State|Remain|Present|Volt'

And

*sudo kldload acpi_ibm*
Password:
kldload: can't load acpi_ibm: module already loaded or in kernel

but

$ ./stat
Fri Feb 13 16:11:11 EET 2015 dev.cpu.0.freq: 1200
0.13% 0.11% 99.75% last 60305us       { 0.12 0.10 0.08 }
0.06% 0.06% 99.87% last 2029us       { LAPIC }
*sysctl: unknown oid 'dev.acpi_ibm': No such file or directory*
hw.acpi.thermal.tz0.temperature: 45.0C
State:            discharging
Remaining capacity:    46%
Remaining time:        1:58
Present rate:        9940 mW
Present voltage:    14128 mV

=E2=80=8BPS: Please do not get angry with me. I am from Greece. I don't spe=
ak good
English. I learned alone through FreeBSD forum!

2015-02-12 11:39 GMT+02:00 Ian Smith <smithi@nimnet.asn.au>:

> On Wed, 11 Feb 2015 18:38:45 +0200, george ember wrote:
>
>  > Hi. I have a lenovo Ideapad p400 touchscreen.
>  > My problem is the battery.
>  > Drains too fast. In idle ~1% per minute!!!
>  > I tried almost everything but my battery still loses power extremely
> fast!
>  > This is my post on FreeBSD forum
>  >
> https://forums.freebsd.org/threads/laptop-battery-drains-extremly-fast.50=
344/
>  > I don't like Linux. I am FreeBSD user almost 5 years. I don't want to
>  > install again Linux on laptop.
>  > I just want to make it work smooth with FreeBSD.
>  > Any help could be appreciated.
>  > George (sk8harddiefast on forum)
>
> George, I read the forum post, but prefer to reply here, though I'll
> quote from bits there. There are a number of issues with your setup:
>
> 1) powerd:
>
>  > powerd_enable=3D"YES"
>  > powerd_flags=3D"-a maximum -b adaptive -i 85 -r 60 -p 100"
>
> You shouldn't have -i (idle%) higher than -r (run%).  The defaults are
> -i 50 -r 75 and I suggest you start with those.  I use -i 70 -r 85 here
> on my X200 (Core2Duo 2.4GHz).  And -p 100 is polling faster than you
> need, increasing powerd's load somewhat.  The default of -p 250 is fine.
>
> -a max is unnecessary.  -a hadp will work fine, especially as you've
> correctly disabled p4tcc and acpi_throttle in loader.conf, when you're
> doing things - but allow it to idle at a lower freq, which will reduce
> heat buildup on AC and perhaps fan usage on battery, at least initially.
>
> 2) C-states:
>
> You have (misadvisedly) in /etc/sysctl.conf
>  > dev.cpu.0.cx_lowest=3DC5
>  > dev.cpu.1.cx_lowest=3DC2
>  > dev.cpu.2.cx_lowest=3DC5
>  > dev.cpu.3.cx_lowest=3DC5
>  > dev.cpu.4.cx_lowest=3DC5
>  > dev.cpu.5.cx_lowest=3DC5
>  > dev.cpu.6.cx_lowest=3DC5
>  > dev.cpu.7.cx_lowest=3DC5
>
> Apart from the oddity of C2 on cpu1, setting these is NOT the way to do
> this, you have to set hw.acpi.cpu.cx_lowest instead, then cpufreq(4)
> uses that to set the individual cx_lowest per CPU (and all to the same
> state) which is usually and best accomplished by setting the below in
> rc.conf, as stated in https://wiki.freebsd.org/TuningPowerConsumption :
>
>  performance_cx_lowest=3D"Cmax"
>  economy_cx_lowest=3D"Cmax"
>
> I expect Adrian will say more, but it looks to me that you're always
> running in C1 state by your report at http://pastebin.com/GUJQqtX6
> which is consistent with use of the defaults for *_cx_lowest as applied
> in /etc/defaults/rc.conf of:
>  performance_cx_lowest=3D"HIGH"    # Online CPU idle state
>  economy_cx_lowest=3D"HIGH"        # Offline CPU idle state
>
> If you examine /etc/rc.d/power_profile you will see how these are used,
> along with the defaults of {performance,economy}_cpu_freq=3D"NONE" which
> you should leave as is, to avoid conflicting with powerd when you apply
> or remove AC power.
>
> Running in C1 all the time, it's no surprise your battery not lasting.
>
> 3) I didn't see mention in dmesg of loading acpi_ibm in loader.conf,
> which may help at least provide details for the script below, if it
> doesn't improve your access to Lenovo special Fn keys etc:
>
>  acpi_ibm_load=3D"YES"    # or just '# kldload acpi_ibm' while running
>
> 4) please show output of
>  sysctl -a | egrep 'cx|freq_'
>
> 5) try putting this script, suitably renamed, somewhere in $PATH.  It
> doesn't needroot access to run, I also have it (as a link) in ~/bin/
>
> root@x200:~ # cat /root/bin/x200stat
> #!/bin/sh
> t=3D"     "       # a tab
> echo -n "`date` "
> sysctl dev.cpu.0.freq
> echo "`sysctl -n dev.cpu.0.cx_usage` $t `sysctl -n vm.loadavg`"
> echo "`sysctl -n dev.cpu.1.cx_usage` $t { `sysctl -n
> kern.eventtimer.timer` }"
> sysctl dev.acpi_ibm | egrep 'fan_|thermal'
> sysctl hw.acpi.thermal.tz0.temperature
> sysctl hw.acpi.thermal.tz1.temperature
> acpiconf -i0 | egrep 'State|Remain|Present|Volt'
>
> to which I would add in the approriate place for yours:
>  echo "`sysctl -n dev.cpu.2.cx_usage`"
>  through
>  echo "`sysctl -n dev.cpu.7.cx_usage`"
> and if yours has more thermal zones, those also.
>
> This provides a convenient way to see how things are going, as it shows
> C-state usage and power comsumption (when on battery) directly:
>
> Thu Feb 12 20:12:47 EST 2015 dev.cpu.0.freq: 800
> 0.79% 12.31% 86.89% last 694us   { 0.51 0.55 0.50 }
> 0.64% 11.17% 88.17% last 227us   { HPET }
> dev.acpi_ibm.0.fan_speed: 3363
> dev.acpi_ibm.0.fan_level: 0
> dev.acpi_ibm.0.thermal: 39 41 -1 39 34 -1 33 -1
> hw.acpi.thermal.tz0.temperature: 39.0C
> hw.acpi.thermal.tz1.temperature: 36.0C
> State:                  high
> Remaining capacity:     99%
> Remaining time:         unknown
> Present rate:           0 mW
> Present voltage:        12413 mV
>
> Ignore these load average figures shown with HPET timecounter, they're
> utter nonsense, this system is completely idle, and shows 0.00 0.00 0.00
> when using LAPIC timecounter - but that's an entirely separate issue :)
>
> 6) of course it's possible you have a dud battery, but if you get powerd
> and C-states working right you should see quite an improvement.
>
> 7) Your girlfriend is cuter than you :)
>
> cheers, Ian
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ7d6nempJR==-2_UdJYFTU1Q1DFz-%2Bh3m4NvRhwcPKLEj6h1Q>