Re: powertop vs upower, troubleshooting battery remaining

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 3, 2019 at 5:13 AM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>
> Hi Chris,
>
> On 03-09-19 01:47, Chris Murphy wrote:
> > This is an hp spectre running Fedora 30 Workstation. On Fedora 29,
> > there was fairly close agreement between powertop and upower and the
> > time estimates were sane.
> >
> > Something's wonky on Fedora 30 and I'm not sure where to begin
> > troubleshooting, although I posted a message on the upstream powertop
> > list.
> >
> > This is what I'm seeing.
> > https://paste.fedoraproject.org/paste/3M7euUWnqZG07KKJQpRQ-w/raw
> >
> > powertop says 108 hours remaining, upower first says 6.8 hours
> > remaining which is much more plausible, but then merely 4 minutes
> > later battery has gone from 93% to 77%, and to a 22 minute remaining
> > estimate. Really? One says the battery reports 268mW of discharge, the
> > other reports 61W discharge. Neither of those is possible.
>
> What you are likely seeing is the fuel-gauge/BMC chip adjusting its
> readings all of a sudden, probably based on battery voltage.
>
> A fuel-gauge can do 2 things to get a "percentage" full reading:
>
> 1) it can measure current going into and out of the battery and keep
> track of the amount of energy in the battery that way, but that does
> not include looses, including looses by the battery-cells's
> self-discharging (which all cells do to some extend).
>
> 2) it can use a battery voltage to percent-full table
>
> Most fuel-gauges use 1 since it is much more fine grained, combined
> with 2 to adjust 1 if the 2 get out of sync too much, since 1
> collects a cumulative amount of errors over time.
>
> I guess that you put this laptop away fully charged and then did
> not use it for a while?

It's a laptop almost always left plugged in. I try to exercise the
battery once a month though, with a complete discharge until it powers
off. In this case, I'd unplugged power within the previous ~10 minutes
trying to reproduce on kernel 5.2.11 what I first saw with 5.3.0-rc6.

> Esp. when charged near 100% the self-discharge
> is pretty high (for long term storage 50-70% charge is advised), but
> the self-discharge is not energy consumed by the mainboard of the laptop,
> it is energy which "disappears" inside the cells itself, so the fuel-gauge
> does not know about it causing the gauge value reported by method 1 above
> to be off by a significant amount. So what I think you saw happening with
> the jump from 93 to 77% is the fuel-gauge correcting the reading based
> on cell voltage. Some fuel-gauge-s do this gradually, this one clearly
> does not.
>
> As for the 61W discharge rate, Your 2 upower runs with 4 minutes in between,
> saw a jump of 4.7Wh in capacity 4.7Wh = 4.7 * 3600 Ws = 16920 Ws(econd)
>
> 16920 Ws / 4min = 16920 Ws / (4 * 60s) = 70.5W so the math certainly
> is spot on there. Now if we had enough manpower it would be nice to
> teach upower to somehow filter out these jumps. But we really do not
> have anyone to work on that. However if you wait a bit then the readings
> should normalize again shortly afterwards.

upower does, powertop doesn't (in contrast to how it worked as
recently as a few months ago on this same laptop)

However, near end of battery it becomes erratic again. Sometimes it
gives no warning and just shuts off, going from ~30 minutes remaining
to "ok bye!". And other times it gets to ~20 minutes (3% battery) and
stays there for nearly an hour within a single minute increase or
decrease in "remaining" value.


> As for the POWERTOP reading of 268mW that does sound wrong, powertop
> uses a moving average for this, did you give it a couple of minutes
> for the readings to stabilize?

Maybe 6 hours. It started out with ~270mW and ends with that, it never
really varies much. And that's not my experience with this same laptop
even as recently as a few months ago. If the vast majority of power
management is in hardware, then I'm suspicious of a powertop bug. Or
otherwise powertop and upower are getting their information from
different sources.

With Fedora 29 (and thus powertop 2.9) the time remaining estimate was
sane, but it seemingly underestimated the draw on the backlight, with
virbr0 consuming as much as I figured the backlight should have been
consuming. Whereas F30/powertop 2.10, the display backlight only shows
up for the first minute of runtime and then it vanishes out of the
list entirely, and even while plugged into power, powertop reports
"The battery reports a discharge rate of 281 mW" which really does
seem bogus.

Anyway, I'll try to collect more info and report it upstream.


-- 
Chris Murphy
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux