public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: "Pihet-XID, Jean" <j-pihet@ti.com>
Cc: Linux PM mailing list <linux-pm@lists.linux-foundation.org>
Subject: Re: System PM QoS patches
Date: Mon, 20 Jun 2011 21:28:21 +0200	[thread overview]
Message-ID: <201106202128.21395.rjw@sisk.pl> (raw)
In-Reply-To: <BANLkTikPaUDQSYuUXO8-s5+gbBmM_0AuVA@mail.gmail.com>

Hi,

[CCing linux-pm]

On Monday, June 20, 2011, Pihet-XID, Jean wrote:
> Hi,
> 
> On Fri, Jun 3, 2011 at 12:23 AM, Paul Walmsley <paul@pwsan.com> wrote:
> > On Thu, 2 Jun 2011, Kevin Hilman wrote:
> >
> >> The main idea is to start from the PM QoS API, and just make all those
> >> APIs take a 'struct device *', and the constraints would be assoicated
> >> with a struct device.  The current system-wide constratints would then
> >> be a special case of the per-device constratints.  Maybe when the struct
> >> device pointer is NULL, that means set a system-wide constraint.  The
> >> existing users of PM QoS could then be easily converted to the new API
> >> by just passing in NULL.
> >
> > There are so few current in-tree users, I'm not sure if that's needed.
> >
> > Of the three system-wide PM QoS parameters, CPU_DMA_LATENCY is the only
> > one that is really set by in-kernel drivers.  And there are only five
> > drivers that use it (fgrep -r PM_QOS_CPU .).
> >
> > mac80211 uses network latency, but only as a way to get some requirements
> > from userspace.  And that's almost certainly the wrong way to do it, since
> > not all network devices have the same latency requirements.  Network
> > throughput isn't used at all.
> >
> >
> > - Paul
> >
> 
> I see 3 implementation options:
> 
> 1) Add an extra parameter to the PM QoS API to take an extra parameter
> for the device ptr, e.g. changing
>     void pm_qos_add_request(struct pm_qos_request_list *dep, int
> pm_qos_class, s32 value)
> to
>     void pm_qos_add_request(struct pm_qos_request_list *dep, struct
> device *dev, int pm_qos_class, s32 value)
> 
> 2) Use a constraints parameter instead of the current parameter list
> of the PM QoS API, e.g. changing
>     void pm_qos_add_request(struct pm_qos_request_list *dep, int
> pm_qos_class, s32 value)
> to
>     void pm_qos_add_request(struct pm_qos_request_list *dep, struct
> pm_qos_params *params), with:
>     struct pm_qos_params { device *dev; int pm_qos_class; s32 value };
> 
> 3) Keep the current API and add a new API for the device wake-up
> latency constraints.

I'm opting for 3, with a twist that the new implementation would use the
majority of the exsiting code (with some modifications).

> The options 1 & 2 have the advantage of keeping the code generic while
> option 3 means duplicating most of the code in kernel/pm_qos_params.c.

You don't need to duplicate it.  Just modify it so that it works with both
the existing API and the new one.

> Also the options 1 & 2 are impacting the current API users but as Paul
> reported it there are so few users so it is not an issue to do so.
> Option 3 has the advantage of being flexible when more parameters will
> be needed in the future.
> 
> What do you think?
> 
> I am currently trying to implement the option 2. More to come!

Good, looking forward to seeing the code. ;-)

Thanks,
Rafael

       reply	other threads:[~2011-06-20 19:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.DEB.2.00.1106021505090.26852@utopia.booyaka.com>
     [not found] ` <alpine.DEB.2.00.1106021614140.26852@utopia.booyaka.com>
     [not found]   ` <BANLkTikPaUDQSYuUXO8-s5+gbBmM_0AuVA@mail.gmail.com>
2011-06-20 19:28     ` Rafael J. Wysocki [this message]
2011-06-21 13:27       ` System PM QoS patches Pihet-XID, Jean

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=201106202128.21395.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=j-pihet@ti.com \
    --cc=linux-pm@lists.linux-foundation.org \
    /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