From: Saravana Kannan <skannan@codeaurora.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
Linaro Kernel Mailman List <linaro-kernel@lists.linaro.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Stephen Boyd <sboyd@codeaurora.org>,
Prarit Bhargava <prarit@redhat.com>
Subject: Re: [PATCH V2 12/20] cpufreq: Mark policy->governor = NULL for inactive policies
Date: Fri, 03 Apr 2015 18:20:59 -0700 [thread overview]
Message-ID: <551F3C7B.7060004@codeaurora.org> (raw)
In-Reply-To: <CAKohpok37PXGxmP+M-d8mpT-eGxaCjtAwgQdZO=mJ9PmvxTv3w@mail.gmail.com>
On 04/01/2015 11:09 PM, Viresh Kumar wrote:
> On 2 April 2015 at 10:08, Saravana Kannan <skannan@codeaurora.org> wrote:
>> What's wrong with this behavior? If you cat scaling_min/max_freq, it's going
>> to show the last minimum and maximum freqs too. I don't think this needs to
>> be set to NULL until the governor is unloaded. Which you are already taking
>> care of in the previous patch.
>>
>> It's handy to be able to tell what governor will be restored when a cluster
>> if offline.
>>
>> Nacked because I think this patch is not helping.
>
> Oh, I really believe this patch makes sense. :)
>
> Don't confuse it with the 'last-governor' thing or scaling_min/max stuff..
> Its different.
Ok, I agree that I misread your other patch and mentally read it as
setting both last_governor to "" and the governor pointer to NULL. I
think if you set the governor to NULL in the same for loop, you would
solve the issues you mention below without compromising the case where
the governor is not removed and you still let userspace query what the
last governor is without having to online a CPU.
I think that's way more user friendly without and real negatives. We
shouldn't make it any less user friendly than it needs to be.
>
> Consider a scenario:
> - Cluster was using ONDEMAND governor.
> - Cluster hotplugged out
> - Governor removed, but the pointer policy->governor isn't updated.
>
> -> At this point accessing 'scaling_governor' or 'scaling_setspeed' can
> get called and that will result in a crash.
>
> - We go ahead and insert the governor again
>
> -> At this point also the same problem will happen as governor will
> get allocated again.
>
> Now, what we are talking about here is a pointer to the governor, not
> its name which is stored in 'last_governor' in the previous patch.
>
> We store that name as it is used for internal working of the core, not for
> userspace.
>
> What we expose to userspace must be consistent, and so if the governor
> is removed, we will not be able to provide 'scaling_setspeed' or
> 'scaling_governor' to userspace.
>
> Also, it is scaling-governor, not what the next governor is going to be.
> Plus, what should we print on scaling_setspeed of a cluster not running
> anymore ?
The same could be said for all the files in that directory. What does it
mean to say scaling_min_freq for a CPU that's hotplugged out. And the
argument can be make for cases when the CPU is power collapsed too. What
does it mean to ask for "current frequency" when it's powered off. The
point is that these files are representing what will be done when the
CPUs are clocked. Not what's happening at this absolute instance.
> And so why keep something that we can't provide to userspace all the
> time. That may break userspace if it relies on it..
Because there are plenty of use cases where the module isn't going to be
removed since it's not even a module. So, still letting userspace figure
out what the last used governor was and what will it come up with is
still useful. And this isn't going to break userspace any more than
returning an error all the time.
I would strongly prefer that this is not done and just clear out the
pointer if/when the governor module is removed.
Nack
Thanks,
Saravana
--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-04-04 1:21 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-19 11:32 [PATCH V2 00/20] cpufreq: Don't loose cpufreq history on CPU hotplug Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 01/20] cpufreq: Add doc style comment about cpufreq_cpu_{get|put}() Viresh Kumar
2015-03-20 0:34 ` Saravana Kannan
2015-02-19 11:32 ` [PATCH V2 02/20] cpufreq: Merge __cpufreq_add_dev() and cpufreq_add_dev() Viresh Kumar
2015-03-20 0:34 ` Saravana Kannan
2015-02-19 11:32 ` [PATCH V2 03/20] cpufreq: Throw warning when we try to get policy for an invalid CPU Viresh Kumar
2015-03-20 0:34 ` Saravana Kannan
2015-02-19 11:32 ` [PATCH V2 04/20] cpufreq: Keep a single path for adding managed CPUs Viresh Kumar
2015-03-20 0:37 ` Saravana Kannan
2015-03-20 3:16 ` Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 05/20] cpufreq: Clear policy->cpus even for the last CPU Viresh Kumar
2015-03-20 0:43 ` Saravana Kannan
2015-02-19 11:32 ` [PATCH V2 06/20] cpufreq: Create for_each_{in}active_policy() Viresh Kumar
2015-03-20 1:01 ` Saravana Kannan
2015-03-20 4:41 ` Viresh Kumar
2015-03-20 19:18 ` Saravana Kannan
2015-05-07 22:11 ` Rafael J. Wysocki
2015-05-08 2:33 ` Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 07/20] cpufreq: Call schedule_work() for the last active policy Viresh Kumar
2015-04-02 3:40 ` Saravana Kannan
2015-04-02 5:02 ` Viresh Kumar
2015-05-07 22:13 ` Rafael J. Wysocki
2015-05-08 2:36 ` Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 08/20] cpufreq: Don't clear cpufreq_cpu_data and policy list for inactive policies Viresh Kumar
2015-04-02 4:14 ` Saravana Kannan
2015-04-02 5:11 ` Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 09/20] cpufreq: Get rid of cpufreq_cpu_data_fallback Viresh Kumar
2015-04-02 4:20 ` Saravana Kannan
2015-02-19 11:32 ` [PATCH V2 10/20] cpufreq: Don't traverse list of all policies for adding policy for a cpu Viresh Kumar
2015-04-02 4:24 ` Saravana Kannan
2015-02-19 11:32 ` [PATCH V2 11/20] cpufreq: Manage governor usage history with 'policy->last_governor' Viresh Kumar
2015-04-02 4:34 ` Saravana Kannan
2015-04-02 5:26 ` Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 12/20] cpufreq: Mark policy->governor = NULL for inactive policies Viresh Kumar
2015-04-02 4:38 ` Saravana Kannan
2015-04-02 6:09 ` Viresh Kumar
2015-04-04 1:20 ` Saravana Kannan [this message]
2015-04-04 3:07 ` Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 13/20] cpufreq: Don't allow updating inactive-policies from sysfs Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 14/20] cpufreq: Track cpu managing sysfs kobjects separately Viresh Kumar
2015-04-02 4:40 ` Saravana Kannan
2015-04-02 5:41 ` Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 15/20] cpufreq: Stop migrating sysfs files on hotplug Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 16/20] cpufreq: Remove cpufreq_update_policy() Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 17/20] cpufreq: Initialize policy->kobj while allocating policy Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 18/20] cpufreq: Call cpufreq_policy_put_kobj() from cpufreq_policy_free() Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 19/20] cpufreq: Restart governor as soon as possible Viresh Kumar
2015-02-19 11:32 ` [PATCH V2 20/20] cpufreq: Add support for physical hoplug of CPUs Viresh Kumar
2015-02-27 5:26 ` [PATCH V2 00/20] cpufreq: Don't loose cpufreq history on CPU hotplug Viresh Kumar
2015-02-28 2:36 ` Saravana Kannan
2015-03-16 9:45 ` Viresh Kumar
2015-03-17 22:13 ` Saravana Kannan
2015-03-26 11:59 ` Viresh Kumar
2015-03-26 20:28 ` Rafael J. Wysocki
2015-03-26 20:41 ` Saravana Kannan
2015-03-27 5:15 ` Viresh Kumar
2015-03-20 0:33 ` Saravana Kannan
2015-05-07 22:18 ` Rafael J. Wysocki
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=551F3C7B.7060004@codeaurora.org \
--to=skannan@codeaurora.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=prarit@redhat.com \
--cc=rjw@rjwysocki.net \
--cc=sboyd@codeaurora.org \
--cc=viresh.kumar@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;
as well as URLs for NNTP newsgroup(s).