<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/cpufreq/cpufreq_userspace.c, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-10-06T20:01:26+00:00</updated>
<entry>
<title>cpufreq: userspace: Move is_managed indicator into per-policy structure</title>
<updated>2023-10-06T20:01:26+00:00</updated>
<author>
<name>Liao Chang</name>
<email>liaochang1@huawei.com</email>
</author>
<published>2023-09-12T06:10:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9ef0ad49cc860c0860026c01abea68878c6d72f7'/>
<id>urn:sha1:9ef0ad49cc860c0860026c01abea68878c6d72f7</id>
<content type='text'>
The userspace governor uses the 'cpu' field of cpufreq_policy structure
to track if it is allowed to set the speed of the policy.

However, there is a window where the 'cpu' field is equal to the value
of nr_cpus_id when all affected CPUs of policy are offline, which is an
illegal value to get the per-CPU variable.

To avoid this issue, modify the governor to use a per-policy indicator
to track if the policy is managed.

Signed-off-by: Liao Chang &lt;liaochang1@huawei.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: userspace: Use fine-grained mutex in userspace governor</title>
<updated>2023-10-06T20:01:26+00:00</updated>
<author>
<name>Liao Chang</name>
<email>liaochang1@huawei.com</email>
</author>
<published>2023-09-12T06:10:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=285189c57391360701af348cd57ca0ba8cbf7ff6'/>
<id>urn:sha1:285189c57391360701af348cd57ca0ba8cbf7ff6</id>
<content type='text'>
The userspace governor currently uses a big global mutex to avoid the
race condition on the governor_data field of cpufreq_policy structure.

This leads to a low concurrency if multiple userspace applications are
trying to set the speed of different policies at the same time.

Introduce a per-policy mutex to allow the updating of different policies
to be performed concurrently, improving overall concurrency.

Signed-off-by: Liao Chang &lt;liaochang1@huawei.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Register governors at core_initcall</title>
<updated>2020-07-02T11:03:30+00:00</updated>
<author>
<name>Quentin Perret</name>
<email>qperret@google.com</email>
</author>
<published>2020-06-29T08:24:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=10dd8573b09e84b81539d939d55ebdb6a36c5f3a'/>
<id>urn:sha1:10dd8573b09e84b81539d939d55ebdb6a36c5f3a</id>
<content type='text'>
Currently, most CPUFreq governors are registered at the core_initcall
time when the given governor is the default one, and the module_init
time otherwise.

In preparation for letting users specify the default governor on the
kernel command line, change all of them to be registered at the
core_initcall unconditionally, as it is already the case for the
schedutil and performance governors. This will allow us to assume
that builtin governors have been registered before the built-in
CPUFreq drivers probe.

And since all governors have similar init/exit patterns now, introduce
two new macros, cpufreq_governor_{init,exit}(), to factorize the code.

Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Quentin Perret &lt;qperret@google.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
[ rjw: Changelog ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Initialize the governors in core_initcall</title>
<updated>2019-11-07T06:00:26+00:00</updated>
<author>
<name>Amit Kucheria</name>
<email>amit.kucheria@linaro.org</email>
</author>
<published>2019-10-21T12:15:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3f6ec871e1c2b360aaf022e90bb99dcc016b3874'/>
<id>urn:sha1:3f6ec871e1c2b360aaf022e90bb99dcc016b3874</id>
<content type='text'>
Initialize the cpufreq governors earlier to allow for earlier
performance control during the boot process.

Signed-off-by: Amit Kucheria &lt;amit.kucheria@linaro.org&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/b98eae9b44eb2f034d7f5d12a161f5f831be1eb7.1571656015.git.amit.kucheria@linaro.org
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500</title>
<updated>2019-06-19T15:09:55+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-06-04T08:11:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d2912cb15bdda8ba4a5dd73396ad62641af2f520'/>
<id>urn:sha1:d2912cb15bdda8ba4a5dd73396ad62641af2f520</id>
<content type='text'>
Based on 2 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Enrico Weigelt &lt;info@metux.net&gt;
Reviewed-by: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cpufreq: governor: Get rid of governor events</title>
<updated>2016-06-02T21:24:15+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-06-02T21:24:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e788892ba3cc71d385b75895f7a375fbc659ce86'/>
<id>urn:sha1:e788892ba3cc71d385b75895f7a375fbc659ce86</id>
<content type='text'>
The design of the cpufreq governor API is not very straightforward,
as struct cpufreq_governor provides only one callback to be invoked
from different code paths for different purposes.  The purpose it is
invoked for is determined by its second "event" argument, causing it
to act as a "callback multiplexer" of sorts.

Unfortunately, that leads to extra complexity in governors, some of
which implement the -&gt;governor() callback as a switch statement
that simply checks the event argument and invokes a separate function
to handle that specific event.

That extra complexity can be eliminated by replacing the all-purpose
-&gt;governor() callback with a family of callbacks to carry out specific
governor operations: initialization and exit, start and stop and policy
limits updates.  That also turns out to reduce the code size too, so
do it.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>cpufreq: Fix GOV_LIMITS handling for the userspace governor</title>
<updated>2016-05-04T23:30:38+00:00</updated>
<author>
<name>Sai Gurrappadi</name>
<email>sgurrappadi@nvidia.com</email>
</author>
<published>2016-04-29T21:44:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e43e94c1eda76dabd686ddf6f7825f54d747b310'/>
<id>urn:sha1:e43e94c1eda76dabd686ddf6f7825f54d747b310</id>
<content type='text'>
Currently, the userspace governor only updates frequency on GOV_LIMITS
if policy-&gt;cur falls outside policy-&gt;{min/max}. However, it is also
necessary to update current frequency on GOV_LIMITS to match the user
requested value if it can be achieved within the new policy-&gt;{max/min}.

This was previously the behaviour in the governor until commit d1922f0
("cpufreq: Simplify userspace governor") which incorrectly assumed that
policy-&gt;cur == user requested frequency via scaling_setspeed. This won't
be true if the user requested frequency falls outside policy-&gt;{min/max}.
Ex: a temporary thermal cap throttled the user requested frequency.

Fix this by storing the user requested frequency in a seperate variable.
The governor will then try to achieve this request on every GOV_LIMITS
change.

Fixes: d1922f02562f (cpufreq: Simplify userspace governor)
Signed-off-by: Sai Gurrappadi &lt;sgurrappadi@nvidia.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Clean up default and fallback governor setup</title>
<updated>2016-02-05T01:37:42+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-02-05T01:37:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=de1df26b7cef702a32ae876ed45c1112f523df48'/>
<id>urn:sha1:de1df26b7cef702a32ae876ed45c1112f523df48</id>
<content type='text'>
The preprocessor magic used for setting the default cpufreq governor
(and for using the performance governor as a fallback one for that
matter) is really nasty, so replace it with __weak functions and
overrides.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Saravana Kannan &lt;skannan@codeaurora.org&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>cpufreq / governor: Remove fossil comment</title>
<updated>2013-10-17T21:00:20+00:00</updated>
<author>
<name>Lan Tianyu</name>
<email>tianyu.lan@intel.com</email>
</author>
<published>2013-09-11T12:49:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a814613b9a32d9ab9578d9dab396265c826d37f0'/>
<id>urn:sha1:a814613b9a32d9ab9578d9dab396265c826d37f0</id>
<content type='text'>
cpufreq_set_policy() has been changed to origin __cpufreq_set_policy()
and policy-&gt;lock has been converted to rewrite lock by commit 5a01f2.
So remove the comment.

Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Fix minor formatting issues</title>
<updated>2013-06-20T23:06:34+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2013-06-19T08:49:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bb176f7d038fee4d46b3293e64e173bfb05ab7b5'/>
<id>urn:sha1:bb176f7d038fee4d46b3293e64e173bfb05ab7b5</id>
<content type='text'>
There were a few noticeable formatting issues in core cpufreq code.
This cleans them up to make code look better.  The changes include:
 - Whitespace cleanup.
 - Rearrangements of code.
 - Multiline comments fixes.
 - Formatting changes to fit 80 columns.

Copyright information in cpufreq.c is also updated to include my name
for 2013.

[rjw: Changelog]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
