public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Javi Merino" <javi.merino@arm.com>
To: Eduardo Valentin <edubezval@gmail.com>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Punit Agrawal <Punit.Agrawal@arm.com>,
	Zhang Rui <rui.zhang@intel.com>
Subject: Re: [RFC PATCH v3 5/7] thermal: add a basic cpu power actor
Date: Fri, 13 Jun 2014 18:01:15 +0100	[thread overview]
Message-ID: <20140613170115.GC3504@e104805> (raw)
In-Reply-To: <20140612142650.GB2763@e104805>

On Thu, Jun 12, 2014 at 03:26:50PM +0100, Javi Merino wrote:
> On Wed, Jun 11, 2014 at 01:05:37PM +0100, Eduardo Valentin wrote:
> > On Tue, Jun 03, 2014 at 11:18:33AM +0100, Javi Merino wrote:
> > > Introduce a power actor for cpus.  It has a basic power model to get
> > > the current power utilization and uses cpufreq cooling devices to set
> > > the desired power.  It uses the current frequency (as reported by
> > > cpufreq) as well as load and OPPs for the power calculations.  The
> > > cpus must have registered their OPPs in the OPP library.
> > >
> > > Cc: Zhang Rui <rui.zhang@intel.com>
> > > Cc: Eduardo Valentin <edubezval@gmail.com>
> > > Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
> > > Signed-off-by: Javi Merino <javi.merino@arm.com>
> > > ---
> > >  Documentation/thermal/power_actor.txt     | 126 +++++++
> > >  drivers/thermal/Kconfig                   |   5 +
> > >  drivers/thermal/power_actor/Kconfig       |   9 +
> > >  drivers/thermal/power_actor/Makefile      |   2 +
> > >  drivers/thermal/power_actor/cpu_actor.c   | 601 ++++++++++++++++++++++++++++++
> > >  drivers/thermal/power_actor/power_actor.h |  41 ++
> > >  6 files changed, 784 insertions(+)
> > >  create mode 100644 drivers/thermal/power_actor/Kconfig
> > >  create mode 100644 drivers/thermal/power_actor/cpu_actor.c
> > >
[...]
> > > diff --git a/drivers/thermal/power_actor/Kconfig b/drivers/thermal/power_actor/Kconfig
> > > new file mode 100644
> > > index 000000000000..fa542ca99cdb
> > > --- /dev/null
> > > +++ b/drivers/thermal/power_actor/Kconfig
> > > @@ -0,0 +1,9 @@
> > > +#
> > > +# Thermal power actor configuration
> > > +#
> > > +
> > > +config THERMAL_POWER_ACTOR_CPU
> > > +     bool
> > > +     prompt "Simple power model for a CPU"
> > > +     help
> > > +       A simple CPU power model
> >
> > A better help is always welcome.
> 
> I guess I can repeat some of the text in the Documentation here.

I've been thinking about it and I'd rather remove the prompt
altogether.  There's no point in asking the user about this, drivers
that use this API can select THERMAL_POWER_ACTOR_CPU themselves.  So
I'll remove the help text.

[...]
> > > diff --git a/drivers/thermal/power_actor/power_actor.h b/drivers/thermal/power_actor/power_actor.h
> > > index 28098f43630b..230317c284b2 100644
> > > --- a/drivers/thermal/power_actor/power_actor.h
> > > +++ b/drivers/thermal/power_actor/power_actor.h
> > > @@ -17,11 +17,16 @@
> > >  #ifndef __POWER_ACTOR_H__
> > >  #define __POWER_ACTOR_H__
> > >
> > > +#include <linux/cpumask.h>
> > > +#include <linux/device.h>
> > > +#include <linux/err.h>
> > >  #include <linux/list.h>
> > > +#include <linux/thermal.h>
> > >
> > >  #define MAX_NUM_ACTORS 8
> > >
> > >  enum power_actor_types {
> > > +     POWER_ACTOR_CPU,
> >
> > Using struct device is more scalable no? What if we want to provide a
> > power actor for a specific bus, or device, or coprocessor? Are we going
> > to maintain this enum for every single new user?
> 
> The counterargument would be, does every single device need to carry
> this?  Anyway, I'll see if we can add the power actor to the "struct
> device".

I've decided to remove the only user of the power_actor_types enum and
remove this field as well.  It's simplifies things which is always
good.

Cheers,
Javi


  reply	other threads:[~2014-06-13 17:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03 10:18 [RFC PATCH v3 0/7] The power allocator thermal governor Javi Merino
2014-06-03 10:18 ` [RFC PATCH v3 1/7] tracing: Add __bitmask() macro to trace events to cpumasks and other bitmasks Javi Merino
2014-06-03 10:18 ` [RFC PATCH v3 2/7] thermal: document struct thermal_zone_device and thermal_governor Javi Merino
2014-06-03 10:18 ` [RFC PATCH v3 3/7] thermal: let governors have private data for each thermal zone Javi Merino
2014-06-03 10:18 ` [RFC PATCH v3 4/7] thermal: introduce the Power Actor API Javi Merino
2014-06-11 11:32   ` Eduardo Valentin
2014-06-12 13:45     ` Javi Merino
2014-06-03 10:18 ` [RFC PATCH v3 5/7] thermal: add a basic cpu power actor Javi Merino
2014-06-11 12:05   ` Eduardo Valentin
2014-06-12 14:26     ` Javi Merino
2014-06-13 17:01       ` Javi Merino [this message]
2014-06-03 10:18 ` [RFC PATCH v3 6/7] thermal: introduce the Power Allocator governor Javi Merino
2014-06-03 10:18 ` [RFC PATCH v3 7/7] thermal: add trace events to the power allocator governor Javi Merino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140613170115.GC3504@e104805 \
    --to=javi.merino@arm.com \
    --cc=Punit.Agrawal@arm.com \
    --cc=edubezval@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox