lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080722141925.GA5593@dhcp35.suse.cz>
Date:	Tue, 22 Jul 2008 08:19:25 -0600
From:	Michal Hocko <mstsxfx@...il.com>
To:	Alexey Starikovskiy <astarikovskiy@...e.de>
Cc:	power@...host.org, arjan@...ux.intel.com,
	linux-kernel@...r.kernel.org
Subject: Re: Why is /sys/class/power_supply/CMB1/energy_now not exported?

On Tue, Jul 22, 2008 at 09:49:03AM +0400, Alexey Starikovskiy wrote:
> It looks like you use current_now as power, not multiplying it by voltage.

You are right, my calculation are simply wrong. I have mixed remaining
capacity (calculated for 2.6.25-2 and 2.6.26) with remaining capacity
and some nonsense for the first 2.6.25 (table below was updated).

Nevertheless, what can be the reason for such a different result for
distrbution kernel?

> You should either not multiply anything, then you have similar units -- charge and current,
> or multiply _both_ by voltage_now, then again you have similar units -- power and energy.
> In these both cases you'll have hours or remaining capacity.
>
[...]
>>
>> I have tried 3 configurations:
>> * 2.6.25 - Vanilla kernel with config-2.6.25 config and result output in
>>   powertop-2.6.25-good
>> * 2.6.25-2 - Debian distribution kernel with config-2.6.25-2 config and
>>   powertop-2.6.25-2-bad output
>> * 2.6.26 - Vanilla kernel with config-2.6.26 config and result output in
>>   powertop-2.6.26-good
>>
>> with the following scenario (powertop patched with attached
>> charge-read.patch):
>> * wait for /sys/class/power_class/CMB1/status FULL on AC
>> * get values from all files in ..CMB1 to output file
>> * unplug AC
>> * run powertop
>> * get values from all files in CMB1 again to the same file
>> * get output of power consumption to the output file
>>
>>
>>              |  2.6.25          2.6.25-2        2.6.26
>> ===========================================================================
>> voltage_now  |  12222000        12206000        12218000
>> charge_now   |  4850000         4850000         4850000
>> current_now  |  1398000         1334000         1313000
>> ---------------------------------------------------------------------------
>> reported     |  16.6            1.4             16.3
>> consumption  |
>> ---------------------------------------------------------------------------
   reported     |  3.5             41.7            3.6
   capacity     |
   ---------------------------------------------------------------------------
   calculated   |  3.46            3.63            3.69
   capacity     |
   ===========================================================================
[...]

-- 
Michal Hocko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ