From: Viresh Kumar <viresh.kumar@linaro.org>
To: Ionela Voinescu <ionela.voinescu@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: topology: Cleanup init_amu_fie() a bit
Date: Thu, 10 Dec 2020 16:25:06 +0530 [thread overview]
Message-ID: <20201210105506.gi76peabl2bv5j62@vireshk-i7> (raw)
In-Reply-To: <20201210103815.GA3313@arm.com>
My intent was to keep the logical working of the code as is (in all
the patches I have sent today), let me see if I broke that assumption
somewhere unintentionally.
On 10-12-20, 10:38, Ionela Voinescu wrote:
> I'm first of all replying to discuss the need of this policy analysis
> that enable_policy_freq_counters() does which results in the setting of
> have_policy.
>
> Basically, that's functions purpose is only to make sure that invariance
> at the level of the policy is consistent: either all CPUs in a policy
> support counters and counters will be used for the scale factor, or
> either none or only some support counters and therefore the default
> cpufreq implementation will be used (arch_set_freq_scale()) for all CPUs
> in a policy.
>
> If we find that cpufreq policies are not present at all, we only enable
> counter use if all CPUs support them.
Right, and the same must be true after this patch.
> This being said, there is a very important part of your patches in this
> set:
>
> + /* Disallow partial use of counters for frequency invariance */
> + if (!cpumask_equal(amu_fie_cpus, cpu_present_mask))
> + goto free_valid_mask;
The current code already has this check and so this isn't something
new.
> If this is agreed upon, there is a lot more that can be removed from the
> initialisation: enable_policy_freq_counters() can entirely go away plus
> all the checks around it.
>
> I completely agree that all of this will be more clear if we decided to
> "Disallow partial use of counters for frequency invariance", but I think
> we might have to add it back in again when systems with partial support
> for counters show up.
>
> I don't agree to not support these systems from the get go as it's
> likely that the first big.LITTLE systems will only have partial support
> for AMUs, but it's only an assumption at this point.
Here is how things move AFAICT:
- We set valid_cpus 1-by-1 with all CPUs that have counters available.
- Once all CPUs of a policy are part of valid_cpus, we update
amu_fie_cpus with that policies related_cpus.
- Once we are done with all CPUs, we check if cpufreq policy was there
for any of the CPUs, if not, we update amu_fie_cpus if all present
CPUs are part of valid_cpus.
- At this point we call static_branch_enable() if amu_fie_cpus is not
empty (i.e. even if it is partially set).
- But right after that we call static_branch_disable() if we aren't
invariant (call to topology_scale_freq_invariant()), and this will
happen if amu_fie_cpus doesn't have all the CPUs there. Isn't it? So
partial amu support is already disallowed, without cpufreq.
Where am I wrong ? (And I know there is a high possibility of that
happening here :) )..
--
viresh
next prev parent reply other threads:[~2020-12-10 10:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-10 7:18 Viresh Kumar
2020-12-10 9:42 ` [PATCH] arm64: topology: Avoid the static_branch_{enable|disable} dance Viresh Kumar
2020-12-10 11:09 ` Ionela Voinescu
2020-12-10 12:35 ` Viresh Kumar
2020-12-10 10:34 ` [PATCH] arm64: topology: Cleanup init_amu_fie() a bit Viresh Kumar
2020-12-10 10:38 ` Ionela Voinescu
2020-12-10 10:55 ` Viresh Kumar [this message]
2020-12-10 11:29 ` Ionela Voinescu
2020-12-10 12:34 ` Viresh Kumar
2020-12-10 13:26 ` Ionela Voinescu
2020-12-11 11:05 ` Viresh Kumar
2020-12-14 16:14 ` Ionela Voinescu
2020-12-10 13:22 ` Ionela Voinescu
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=20201210105506.gi76peabl2bv5j62@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=ionela.voinescu@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=will@kernel.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®