mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Qais Yousef <qais.yousef@arm.com>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
	linux-pm@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>,
	mka@chromium.org, juri.lelli@gmail.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 4/5] cpufreq: Register notifiers with the PM QoS framework
Date: Mon, 25 Feb 2019 10:01:49 +0530	[thread overview]
Message-ID: <20190225043149.bfl5vdb57xaaje2w@vireshk-i7> (raw)
In-Reply-To: <20190222114446.cmwoe7tanxvf2gxh@e107158-lin.cambridge.arm.com>

On 22-02-19, 11:44, Qais Yousef wrote:
> Hi Verish
> 
> On 02/21/19 16:59, Viresh Kumar wrote:
> 
> [...]
> 
> > @@ -2239,6 +2314,8 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
> >  			      struct cpufreq_policy *new_policy)
> >  {
> >  	struct cpufreq_governor *old_gov;
> > +	struct device *cpu_dev = get_cpu_device(policy->cpu);
> > +	unsigned long min, max;
> >  	int ret;
> >  
> >  	pr_debug("setting new policy for CPU %u: %u - %u kHz\n",
> > @@ -2253,11 +2330,23 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
> >  	if (new_policy->min > new_policy->max)
> >  		return -EINVAL;
> >  
> > +	min = dev_pm_qos_read_value(cpu_dev, DEV_PM_QOS_MIN_FREQUENCY);
> > +	max = dev_pm_qos_read_value(cpu_dev, DEV_PM_QOS_MAX_FREQUENCY);
> > +
> > +	if (min > new_policy->min)
> > +		new_policy->min = min;
> > +	if (max < new_policy->max)
> > +		new_policy->max = max;
> > +
> 
> Assuming for example min and max range from 1-10, and thermal throttles max to
> 5 using pm_qos to deal with temporary thermal pressure. But shortly after
> a driver thinks that max shouldn't be greater than 7 for one reason or another.
> 
> What will happen after thermal pressure removes its constraint? Will we still
> remember the driver's request and apply it so max is set to 7 instead of 10?

Once everything comes via PM QoS, it will remember all the presently available
requests and choose a target min/max frequency based on that.

But even with this patchset, with half stuff done with PM QoS and half done with
cpufreq notifiers, it should still work that way only.

-- 
viresh

  reply	other threads:[~2019-02-25  4:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 11:29 [PATCH V2 0/5] cpufreq: Use QoS layer to manage freq-constraints Viresh Kumar
2019-02-21 11:29 ` [PATCH V2 1/5] PM / QOS: Pass request type to dev_pm_qos_{add|remove}_notifier() Viresh Kumar
2019-02-21 11:29 ` [PATCH V2 2/5] PM / QOS: Pass request type to dev_pm_qos_read_value() Viresh Kumar
2019-02-21 11:29 ` [PATCH V2 3/5] PM / QoS: Add support for MIN/MAX frequency constraints Viresh Kumar
2019-02-21 11:29 ` [PATCH V2 4/5] cpufreq: Register notifiers with the PM QoS framework Viresh Kumar
2019-02-22 11:44   ` Qais Yousef
2019-02-25  4:31     ` Viresh Kumar [this message]
2019-02-25  8:58       ` Qais Yousef
2019-02-25  9:09         ` Viresh Kumar
2019-02-25 12:14           ` Qais Yousef
2019-02-26  2:30             ` Viresh Kumar
2019-02-26 10:00               ` Qais Yousef
2019-02-21 11:29 ` [PATCH V2 5/5] cpufreq: Add QoS requests for userspace constraints Viresh Kumar
2019-02-21 11:30 ` [PATCH V2 0/5] cpufreq: Use QoS layer to manage freq-constraints Rafael J. Wysocki
2019-04-08 10:46   ` Viresh Kumar
2019-05-20  6:16   ` Viresh Kumar

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=20190225043149.bfl5vdb57xaaje2w@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=juri.lelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=qais.yousef@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=vincent.guittot@linaro.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

all inboxes | Powered by JetHome®