LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/2] Define sysfs interfaces for ibmaem driver
@ 2008-03-28 21:36 Darrick J. Wong
  2008-03-29 13:56 ` Jean Delvare
  0 siblings, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2008-03-28 21:36 UTC (permalink / raw)
  To: Mark M. Hoffman; +Cc: linux-kernel, lm-sensors

Update sysfs interface documentation to include energy meters and power
meter averaging intervals.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
---

 Documentation/hwmon/sysfs-interface |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
index f4a8ebc..85e6654 100644
--- a/Documentation/hwmon/sysfs-interface
+++ b/Documentation/hwmon/sysfs-interface
@@ -328,6 +328,14 @@ curr[1-*]_input	Current input value
 		Unit: milliampere
 		RO
 
+**********
+* Energy *
+**********
+
+energy[1-*]_input		Instantaneous energy use
+				Unit: microJoule
+				RO
+
 *********
 * Power *
 *********
@@ -336,6 +344,10 @@ power[1-*]_average		Average power use
 				Unit: microWatt
 				RO
 
+power[1-*]_interval		Power use averaging interval
+				Unit: milliseconds
+				RW
+
 power[1-*]_average_highest	Historical average maximum power use
 				Unit: microWatt
 				RO

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] Define sysfs interfaces for ibmaem driver
  2008-03-28 21:36 [PATCH 1/2] Define sysfs interfaces for ibmaem driver Darrick J. Wong
@ 2008-03-29 13:56 ` Jean Delvare
  2008-03-31 19:55   ` Wes Felter
  2008-03-31 21:01   ` Darrick J. Wong
  0 siblings, 2 replies; 6+ messages in thread
From: Jean Delvare @ 2008-03-29 13:56 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Mark M. Hoffman, linux-kernel, lm-sensors

Hi Darrick,

On Fri, 28 Mar 2008 14:36:46 -0700, Darrick J. Wong wrote:
> Update sysfs interface documentation to include energy meters and power
> meter averaging intervals.
> 
> Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
> ---
> 
>  Documentation/hwmon/sysfs-interface |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
> index f4a8ebc..85e6654 100644
> --- a/Documentation/hwmon/sysfs-interface
> +++ b/Documentation/hwmon/sysfs-interface
> @@ -328,6 +328,14 @@ curr[1-*]_input	Current input value
>  		Unit: milliampere
>  		RO
>  
> +**********
> +* Energy *
> +**********
> +
> +energy[1-*]_input		Instantaneous energy use

This doesn't make sense to me. Energy is a quantity, it exists
independently of time. An "instantaneous energy use" only makes sense
if you tell in what (presumably very small) amount of time the energy
was used... and then what you are measuring is not an energy but a
power, for which we already have an interface. Please clarify.

> +				Unit: microJoule
> +				RO
> +
>  *********
>  * Power *
>  *********
> @@ -336,6 +344,10 @@ power[1-*]_average		Average power use
>  				Unit: microWatt
>  				RO
>  
> +power[1-*]_interval		Power use averaging interval

Wouldn't power[1-*]_average_interval be clearer?

> +				Unit: milliseconds

Nitpicking for consistency: millisecond (no trailing s).

What values do you expect for this entry? I am wondering if it's safe
to use millisecond as a unit. Is it unlikely that a future chip will
support averaging intervals below the millisecond?

> +				RW
> +
>  power[1-*]_average_highest	Historical average maximum power use
>  				Unit: microWatt
>  				RO


-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] Define sysfs interfaces for ibmaem driver
  2008-03-29 13:56 ` Jean Delvare
@ 2008-03-31 19:55   ` Wes Felter
  2008-03-31 21:01   ` Darrick J. Wong
  1 sibling, 0 replies; 6+ messages in thread
From: Wes Felter @ 2008-03-31 19:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: lm-sensors

Jean Delvare wrote:

> On Fri, 28 Mar 2008 14:36:46 -0700, Darrick J. Wong wrote:

>> +energy[1-*]_input		Instantaneous energy use
> 
> This doesn't make sense to me. Energy is a quantity, it exists
> independently of time. An "instantaneous energy use" only makes sense
> if you tell in what (presumably very small) amount of time the energy
> was used... and then what you are measuring is not an energy but a
> power, for which we already have an interface. Please clarify.

I agree. May I suggest "cumulative energy use"?

Wes Felter - wesley@felter.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] Define sysfs interfaces for ibmaem driver
  2008-03-29 13:56 ` Jean Delvare
  2008-03-31 19:55   ` Wes Felter
@ 2008-03-31 21:01   ` Darrick J. Wong
  2008-04-01  8:22     ` Jean Delvare
  1 sibling, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2008-03-31 21:01 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Mark M. Hoffman, linux-kernel, lm-sensors

On Sat, Mar 29, 2008 at 02:56:03PM +0100, Jean Delvare wrote:
> > +energy[1-*]_input		Instantaneous energy use
> 
> This doesn't make sense to me. Energy is a quantity, it exists
> independently of time. An "instantaneous energy use" only makes sense
> if you tell in what (presumably very small) amount of time the energy
> was used... and then what you are measuring is not an energy but a
> power, for which we already have an interface. Please clarify.

Wes Felter suggested "Cumulative energy use", and I'll go with that.

> > +power[1-*]_interval		Power use averaging interval
> 
> Wouldn't power[1-*]_average_interval be clearer?

Given that power is energy used over a period of time, I wonder if it
might be more accurate to remove powerX_input and leave this name alone.
That said, it does seem to be the case that interval names take the
format "${sensorfile}_interval", so I suppose it makes more sense the
way that you suggest.

> > +				Unit: milliseconds
> 
> Nitpicking for consistency: millisecond (no trailing s).
> 
> What values do you expect for this entry? I am wondering if it's safe
> to use millisecond as a unit. Is it unlikely that a future chip will
> support averaging intervals below the millisecond?

It's possible that a future chip could do this, though today we only
support intervals in the hundreds of milliseconds.  The default for the
ibmaem driver is currently 1s.

--D

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] Define sysfs interfaces for ibmaem driver
  2008-03-31 21:01   ` Darrick J. Wong
@ 2008-04-01  8:22     ` Jean Delvare
  2008-04-01  8:47       ` Darrick J. Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Jean Delvare @ 2008-04-01  8:22 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Mark M. Hoffman, linux-kernel, lm-sensors

On Mon, 31 Mar 2008 14:01:35 -0700, Darrick J. Wong wrote:
> On Sat, Mar 29, 2008 at 02:56:03PM +0100, Jean Delvare wrote:
> > > +energy[1-*]_input		Instantaneous energy use
> > 
> > This doesn't make sense to me. Energy is a quantity, it exists
> > independently of time. An "instantaneous energy use" only makes sense
> > if you tell in what (presumably very small) amount of time the energy
> > was used... and then what you are measuring is not an energy but a
> > power, for which we already have an interface. Please clarify.
> 
> Wes Felter suggested "Cumulative energy use", and I'll go with that.

OK. Another question that comes to my mind now is the unit... Do the
chips express the value in Joules internally? I would have expected
Watt-hours. Of course we can convert as needed, but if all known chips
use the same unit then I think we should that unit too, to minimize the
required conversions.

> > > +power[1-*]_interval		Power use averaging interval
> > 
> > Wouldn't power[1-*]_average_interval be clearer?
> 
> Given that power is energy used over a period of time, I wonder if it
> might be more accurate to remove powerX_input and leave this name alone.

It really depends on what the chips report. Typically the drivers
should report the values from the chip without too much tinkering
(other than conversion to standard units). If some chips can report
both "instantaneous" and "average" power uses, it makes sense to have
both sets of filenames in the standard interface. If not then I am fine
getting rid of one set.

> That said, it does seem to be the case that interval names take the
> format "${sensorfile}_interval", so I suppose it makes more sense the
> way that you suggest.

I don't think there is any precedent yet. I suggested this for
unambiguity rather than consistency.

> > > +				Unit: milliseconds
> > 
> > Nitpicking for consistency: millisecond (no trailing s).
> > 
> > What values do you expect for this entry? I am wondering if it's safe
> > to use millisecond as a unit. Is it unlikely that a future chip will
> > support averaging intervals below the millisecond?
> 
> It's possible that a future chip could do this, though today we only
> support intervals in the hundreds of milliseconds.  The default for the
> ibmaem driver is currently 1s.

Oh well, I guess that anything shorter than 1 ms can be considered
"instantaneous power use", so we can go with millisecond.

Out of curiosity, what are the values supported by the ibmaem chip?

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] Define sysfs interfaces for ibmaem driver
  2008-04-01  8:22     ` Jean Delvare
@ 2008-04-01  8:47       ` Darrick J. Wong
  0 siblings, 0 replies; 6+ messages in thread
From: Darrick J. Wong @ 2008-04-01  8:47 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Mark M. Hoffman, linux-kernel, lm-sensors

[Got in a car accident tonight; replies will be scarce for the next week
or two.... :(]

On Tue, Apr 01, 2008 at 10:22:28AM +0200, Jean Delvare wrote:

> OK. Another question that comes to my mind now is the unit... Do the
> chips express the value in Joules internally? I would have expected
> Watt-hours. Of course we can convert as needed, but if all known chips
> use the same unit then I think we should that unit too, to minimize the
> required conversions.

The IBM chips report some form of Joules, not Wh.

> It really depends on what the chips report. Typically the drivers
> should report the values from the chip without too much tinkering
> (other than conversion to standard units). If some chips can report
> both "instantaneous" and "average" power uses, it makes sense to have
> both sets of filenames in the standard interface. If not then I am fine
> getting rid of one set.

Hmm, I'll think about what I want to do with this.  Probably just leave
them.

> I don't think there is any precedent yet. I suggested this for
> unambiguity rather than consistency.

Ok.

> Oh well, I guess that anything shorter than 1 ms can be considered
> "instantaneous power use", so we can go with millisecond.

Ok.

> Out of curiosity, what are the values supported by the ibmaem chip?

I don't know what the lower limits are; it depends on how often the BMC
decides to update the counters, and that seems to vary by machine.

--D

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-04-01  8:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-28 21:36 [PATCH 1/2] Define sysfs interfaces for ibmaem driver Darrick J. Wong
2008-03-29 13:56 ` Jean Delvare
2008-03-31 19:55   ` Wes Felter
2008-03-31 21:01   ` Darrick J. Wong
2008-04-01  8:22     ` Jean Delvare
2008-04-01  8:47       ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).