All of lore.kernel.org
 help / color / mirror / Atom feed
From: skannan@codeaurora.org
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Saravana Kannan <skannan@codeaurora.org>,
	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 05/18] cpufreq: Manage governor usage history with 'policy->last_governor'
Date: Thu, 12 Feb 2015 08:00:55 -0000	[thread overview]
Message-ID: <a0d981c970a45d59bae727789a8b7834.squirrel@www.codeaurora.org> (raw)
In-Reply-To: <CAKohpomFvGXacyc-huavSyGxasrcKY19591OLMnAWY4hJHo9ow@mail.gmail.com>


Viresh Kumar wrote:
> On 12 February 2015 at 11:03, Saravana Kannan <skannan@codeaurora.org>
> wrote:
>>> -       gov = find_governor(per_cpu(cpufreq_cpu_governor,
>>> policy->cpu));
>>> +       gov = find_governor(policy->last_governor);
>>
>> Just change this to:
>>
>> gov = policy->governor;
>>
>> No need to search for the governor again. It should already be valid for
>> policy that's being restored. For new policies, it would be NULL and
>> would
>> get defaulted correctly.
>
> No. Apart from the fact that one of my patches is making it NULL
> intentionally,
> here are the problems that I see with reusing the pointer:
> - All CPUs of a policy are down
> - The last used governor is removed (was built in as a module)
> - Now if we online the CPUs again, it wouldn't work as the pointer
> insn't usable.
> - Or if we insert the governor again, pointers would change and then
> onlining the
> CPUs wouldn't work..

I think for logical hotplug we should lock the governor from being
removed. Or, if you don't want that, go set the pointer to NULL lazily
when/if that happens.

>
>> 2. For physical hotplug of CPUs, the policies are getting freed (I
>> assume
>> and hope so). So, the "last_governor" field is going to be empty.
>
> Its not about it being empty. Its more about when we don't remove them
> physically..
>
>> 3. Even if we continue storing the last_governor outside of the policy,
>> for
>> physical hotplug of CPUs where the policy is getting recreated, I'm not
>> sure
>> restoring the governor is the right thing to do anyway. I'll explain
>> various
>> possible configurations below for the physical hotplug case:
>
> We do it today as this is part of the per-cpu stuff now and my patch would
> fix
> it then :)
>

I'm not sure if you read rest of my email. Unless you added some patches
recently, restoring the last_governor is definitely functionally broken as
of at least 3.12. Probably 3.14 too (I need to check again). It just
restores the governor with the default tunables. So, it's kinda useless in
the real world. You might as well set it to default governor because it's
just as helpful as using the last governor with different tunables.

-Saravana

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


  reply	other threads:[~2015-02-12  8:00 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-27  8:36 [PATCH 00/18] cpufreq: don't loose cpufreq history on CPU hotplug Viresh Kumar
2015-01-27  8:36 ` [PATCH 01/18] cpufreq: Drop cpufreq_disabled() check from cpufreq_cpu_{get|put}() Viresh Kumar
2015-02-03 22:17   ` Saravana Kannan
2015-01-27  8:36 ` [PATCH 02/18] cpufreq: Create for_each_policy() Viresh Kumar
2015-02-03 22:22   ` Saravana Kannan
2015-02-04  4:53     ` Viresh Kumar
2015-01-27  8:36 ` [PATCH 03/18] cpufreq: Create for_each_governor() Viresh Kumar
2015-02-03 22:23   ` Saravana Kannan
2015-01-27  8:36 ` [PATCH 04/18] cpufreq: Manage fallback policies in a list Viresh Kumar
2015-02-03  0:41   ` Rafael J. Wysocki
2015-02-03  4:10     ` Viresh Kumar
2015-02-03 15:04       ` Rafael J. Wysocki
2015-02-04  6:18         ` Viresh Kumar
2015-02-03 22:28   ` Saravana Kannan
2015-02-04  6:20     ` Viresh Kumar
2015-02-04 22:28       ` Saravana Kannan
2015-02-04 23:20         ` Rafael J. Wysocki
2015-02-05  1:55           ` Saravana Kannan
2015-02-05 15:11             ` Rafael J. Wysocki
2015-02-05 22:55               ` Saravana Kannan
2015-02-17  8:06               ` Viresh Kumar
2015-02-17 18:15                 ` Rafael J. Wysocki
2015-02-18  4:23                   ` Viresh Kumar
2015-02-18 21:15                     ` Saravana Kannan
2015-02-19  3:24                       ` Viresh Kumar
2015-01-27  8:36 ` [PATCH 05/18] cpufreq: Manage governor usage history with 'policy->last_governor' Viresh Kumar
2015-02-12  3:03   ` Saravana Kannan
2015-02-12  7:44     ` Viresh Kumar
2015-02-12  8:00       ` skannan [this message]
2015-02-17  8:02         ` Viresh Kumar
2015-01-27  8:36 ` [PATCH 06/18] cpufreq: Reuse policy list instead of per-cpu variable 'cpufreq_cpu_data' Viresh Kumar
2015-02-12  3:13   ` Saravana Kannan
2015-02-12  7:48     ` Viresh Kumar
2015-01-27  8:36 ` [PATCH 07/18] cpufreq: Drop (now) useless check 'cpu > nr_cpu_ids' Viresh Kumar
2015-02-12  3:15   ` Saravana Kannan
2015-02-12  7:50     ` Viresh Kumar
2015-01-27  8:36 ` [PATCH 08/18] cpufreq: Add doc style comment about cpufreq_cpu_{get|put}() Viresh Kumar
2015-02-12  3:19   ` Saravana Kannan
2015-02-12  7:52     ` Viresh Kumar
2015-01-27  8:36 ` [PATCH 09/18] cpufreq: Mark policy->governor = NULL for fallback policies Viresh Kumar
2015-02-12  3:22   ` Saravana Kannan
2015-02-12  7:56     ` Viresh Kumar
2015-01-27  8:36 ` [PATCH 10/18] cpufreq: Don't allow updating inactive-policies from sysfs Viresh Kumar
2015-02-12  3:24   ` Saravana Kannan
2015-01-27  8:36 ` [PATCH 11/18] cpufreq: Track cpu managing sysfs kobjects separately Viresh Kumar
2015-01-27  8:36 ` [PATCH 12/18] cpufreq: Stop migrating sysfs files on hotplug Viresh Kumar
2015-01-27  8:36 ` [PATCH 13/18] cpufreq: Keep a single path for adding managed CPUs Viresh Kumar
2015-01-27  8:36 ` [PATCH 14/18] cpufreq: Remove cpufreq_update_policy() Viresh Kumar
2015-01-27  8:36 ` [PATCH 15/18] cpufreq: Initialize policy->kobj while allocating policy Viresh Kumar
2015-01-27  8:36 ` [PATCH 16/18] cpufreq: Call cpufreq_policy_put_kobj() from cpufreq_policy_free() Viresh Kumar
2015-01-27  8:36 ` [PATCH 17/18] cpufreq: Restart governor as soon as possible Viresh Kumar
2015-01-27  8:36 ` [PATCH 18/18] cpufreq: Merge __cpufreq_add_dev() and cpufreq_add_dev() Viresh Kumar
2015-01-27 15:06 ` [PATCH 00/18] cpufreq: don't loose cpufreq history on CPU hotplug Rafael J. Wysocki
2015-01-27 14:59   ` Viresh Kumar
2015-01-28 19:35 ` Saravana Kannan
2015-01-29  1:43   ` Viresh Kumar
2015-02-03  0:30 ` 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=a0d981c970a45d59bae727789a8b7834.squirrel@www.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.