|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4 |
|
| #
b7902803 |
| 25-Apr-2025 |
Rafael J. Wysocki <[email protected]> |
cpufreq: Fix setting policy limits when frequency tables are used
Commit 7491cdf46b5c ("cpufreq: Avoid using inconsistent policy->min and policy->max") overlooked the fact that policy->min and polic
cpufreq: Fix setting policy limits when frequency tables are used
Commit 7491cdf46b5c ("cpufreq: Avoid using inconsistent policy->min and policy->max") overlooked the fact that policy->min and policy->max were accessed directly in cpufreq_frequency_table_target() and in the functions called by it. Consequently, the changes made by that commit led to problems with setting policy limits.
Address this by passing the target frequency limits to __resolve_freq() and cpufreq_frequency_table_target() and propagating them to the functions called by the latter.
Fixes: 7491cdf46b5c ("cpufreq: Avoid using inconsistent policy->min and policy->max") Cc: 5.16+ <[email protected]> # 5.16+ Closes: https://lore.kernel.org/linux-pm/[email protected]/ Reported-by: Stephan Gerhold <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Tested-by: Stephan Gerhold <[email protected]> Reviewed-by: Lifeng Zheng <[email protected]> Link: https://patch.msgid.link/[email protected]
show more ...
|
|
Revision tags: v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2 |
|
| #
97a705dc |
| 05-Feb-2025 |
Dhananjay Ugwekar <[email protected]> |
cpufreq/amd-pstate: Use scope based cleanup for cpufreq_policy refs
There have been instances in past where refcount decrementing is missed while exiting a function. Use automatic scope based cleanu
cpufreq/amd-pstate: Use scope based cleanup for cpufreq_policy refs
There have been instances in past where refcount decrementing is missed while exiting a function. Use automatic scope based cleanup to avoid such errors.
Signed-off-by: Dhananjay Ugwekar <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Reviewed-by: Gautham R. Shenoy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mario Limonciello <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc1 |
|
| #
38e480d4 |
| 31-Jan-2025 |
Beata Michalska <[email protected]> |
cpufreq: Allow arch_freq_get_on_cpu to return an error
Allow arch_freq_get_on_cpu to return an error for cases when retrieving current CPU frequency is not possible, whether that being due to lack o
cpufreq: Allow arch_freq_get_on_cpu to return an error
Allow arch_freq_get_on_cpu to return an error for cases when retrieving current CPU frequency is not possible, whether that being due to lack of required arch support or due to other circumstances when the current frequency cannot be determined at given point of time.
Signed-off-by: Beata Michalska <[email protected]> Reviewed-by: Prasanna Kumar T S M <[email protected]> Acked-by: Viresh Kumar <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
show more ...
|
| #
0322f3e8 |
| 23-Jan-2025 |
Viresh Kumar <[email protected]> |
cpufreq: Remove cpufreq_enable_boost_support()
Remove the now unused helper, cpufreq_enable_boost_support().
Signed-off-by: Viresh Kumar <[email protected]>
|
| #
c952775a |
| 23-Jan-2025 |
Viresh Kumar <[email protected]> |
cpufreq: staticize policy_has_boost_freq()
policy_has_boost_freq() isn't used outside of freq_table.c now, mark it static.
Signed-off-by: Viresh Kumar <[email protected]>
|
| #
1f7d1bab |
| 23-Jan-2025 |
Viresh Kumar <[email protected]> |
cpufreq: Introduce policy->boost_supported flag
It is possible to have a scenario where not all cpufreq policies support boost frequencies. And letting sysfs (or other parts of the kernel) enable bo
cpufreq: Introduce policy->boost_supported flag
It is possible to have a scenario where not all cpufreq policies support boost frequencies. And letting sysfs (or other parts of the kernel) enable boost feature for that policy isn't correct.
Add a new flag, boost_supported, which will be set to true by the cpufreq core only if the freq table contains valid boost frequencies.
Some cpufreq drivers though don't have boost frequencies in the freq-table, they can set this flag from their ->init() callbacks.
Once all the drivers are updated to set the flag correctly, we can check it before enabling boost feature for a policy.
Signed-off-by: Viresh Kumar <[email protected]>
show more ...
|
| #
9a23eb8b |
| 23-Jan-2025 |
Viresh Kumar <[email protected]> |
cpufreq: Export cpufreq_boost_set_sw()
This will be used directly by cpufreq driver going forward, export it.
Signed-off-by: Viresh Kumar <[email protected]>
|
| #
1f048150 |
| 23-Jan-2025 |
Viresh Kumar <[email protected]> |
cpufreq: staticize cpufreq_boost_trigger_state()
cpufreq_boost_trigger_state() is only used by cpufreq core, mark it static.
Signed-off-by: Viresh Kumar <[email protected]>
|
| #
486729c6 |
| 22-Jan-2025 |
Viresh Kumar <[email protected]> |
cpufreq: Remove cpufreq_generic_attrs
All users of cpufreq_generic_attr are migrated now, remove it. While at it, also stop exporting attributes for available and boost frequencies as they are only
cpufreq: Remove cpufreq_generic_attrs
All users of cpufreq_generic_attr are migrated now, remove it. While at it, also stop exporting attributes for available and boost frequencies as they are only used by cpufreq core now.
Signed-off-by: Viresh Kumar <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]>
show more ...
|
|
Revision tags: v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1 |
|
| #
c0f02536 |
| 17-Sep-2024 |
Miquel Sabaté Solà <[email protected]> |
cpufreq: Avoid a bad reference count on CPU node
In the parse_perf_domain function, if the call to of_parse_phandle_with_args returns an error, then the reference to the CPU device node that was acq
cpufreq: Avoid a bad reference count on CPU node
In the parse_perf_domain function, if the call to of_parse_phandle_with_args returns an error, then the reference to the CPU device node that was acquired at the start of the function would not be properly decremented.
Address this by declaring the variable with the __free(device_node) cleanup attribute.
Signed-off-by: Miquel Sabaté Solà <[email protected]> Acked-by: Viresh Kumar <[email protected]> Link: https://patch.msgid.link/[email protected] Cc: All applicable <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
|
Revision tags: v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1 |
|
| #
37c6dccd |
| 28-Jul-2024 |
Qais Yousef <[email protected]> |
cpufreq: Remove LATENCY_MULTIPLIER
The current LATENCY_MULTIPLIER which has been around for nearly 20 years causes rate_limit_us to be always in ms range.
On M1 mac mini I get 50 and 56us transitio
cpufreq: Remove LATENCY_MULTIPLIER
The current LATENCY_MULTIPLIER which has been around for nearly 20 years causes rate_limit_us to be always in ms range.
On M1 mac mini I get 50 and 56us transition latency, but due to the 1000 multiplier we end up setting rate_limit_us to 50 and 56ms, which gets capped into 2ms and was 10ms before e13aa799c2a6 ("cpufreq: Change default transition delay to 2ms")
On Intel I5 system transition latency is 20us but due to the multiplier we end up with 20ms that again is capped to 2ms.
Given how good modern hardware and how modern workloads require systems to be more responsive to cater for sudden changes in workload (tasks sleeping/wakeup/migrating, uclamp causing a sudden boost or cap) and that 2ms is quarter of the time of 120Hz refresh rate system, drop the old logic in favour of providing 50% headroom.
rate_limit_us = 1.5 * latency.
I considered not adding any headroom which could mean that we can end up with infinite back-to-back requests.
I also considered providing a constant headroom (e.g: 100us) assuming that any h/w or f/w dealing with the request shouldn't require a large headroom when transition_latency is actually high.
But for both cases I wasn't sure if h/w or f/w can end up being overwhelmed dealing with the freq requests in a potentially busy system. So I opted for providing 50% breathing room.
This is expected to impact schedutil only as the other user, dbs_governor, takes the max(2*tick, transition_delay_us) and the former was at least 2ms on 1ms TICK, which is equivalent to the max_delay_us before applying this patch. For systems with TICK of 4ms, this value would have almost always ended up with 8ms sampling rate.
For systems that report 0 transition latency, we still default to returning 1ms as transition delay.
This helps in eliminating a source of latency for applying requests as mentioned in [1]. For example if we have a 1ms tick, most systems will miss sending an update at tick when updating the util_avg for a task/CPU (rate_limit_us will be 2ms for most systems).
Link: https://lore.kernel.org/lkml/20240724212255.mfr2ybiv2j2uqek7@airbuntu/ # [1] Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Qais Yousef <[email protected]> Link: https://patch.msgid.link/[email protected] [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
|
Revision tags: v6.10, v6.10-rc7 |
|
| #
b4b1ddc9 |
| 04-Jul-2024 |
Lizhe <[email protected]> |
cpufreq: Make cpufreq_driver->exit() return void
The cpufreq core doesn't check the return type of the exit() callback and there is not much the core can do on failures at that point. Just drop the
cpufreq: Make cpufreq_driver->exit() return void
The cpufreq core doesn't check the return type of the exit() callback and there is not much the core can do on failures at that point. Just drop the returned value and make it return void.
Signed-off-by: Lizhe <[email protected]> [ Viresh: Reworked the patches to fix all missing changes together. ] Signed-off-by: Viresh Kumar <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> # Mediatek Acked-by: Sudeep Holla <[email protected]> # scpi, scmi, vexpress Acked-by: Mario Limonciello <[email protected]> # amd Reviewed-by: Florian Fainelli <[email protected]> # bmips Acked-by: Rafael J. Wysocki <[email protected]> Acked-by: Kevin Hilman <[email protected]> # omap
show more ...
|
|
Revision tags: v6.10-rc6 |
|
| #
43c0226c |
| 27-Jun-2024 |
Dhruva Gole <[email protected]> |
cpufreq: make cpufreq_boost_enabled() return bool
Since this function is supposed to return boost_enabled which is anyway a bool type make sure that it's return value is also marked as bool. This he
cpufreq: make cpufreq_boost_enabled() return bool
Since this function is supposed to return boost_enabled which is anyway a bool type make sure that it's return value is also marked as bool. This helps maintain better consistency in data types being used.
Signed-off-by: Dhruva Gole <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
|
Revision tags: v6.10-rc5, v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2 |
|
| #
75d65931 |
| 26-Mar-2024 |
Vincent Guittot <[email protected]> |
cpufreq: Add a cpufreq pressure feedback for the scheduler
Provide to the scheduler a feedback about the temporary max available capacity. Unlike arch_update_thermal_pressure(), this doesn't need to
cpufreq: Add a cpufreq pressure feedback for the scheduler
Provide to the scheduler a feedback about the temporary max available capacity. Unlike arch_update_thermal_pressure(), this doesn't need to be filtered as the pressure will happen for dozens of ms or more.
Signed-off-by: Vincent Guittot <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Tested-by: Lukasz Luba <[email protected]> Reviewed-by: Qais Yousef <[email protected]> Reviewed-by: Lukasz Luba <[email protected]> Reviewed-by: Dhruva Gole <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Acked-by: Viresh Kumar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
show more ...
|
|
Revision tags: v6.9-rc1, v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3, v6.8-rc2, v6.8-rc1 |
|
| #
838a4772 |
| 18-Jan-2024 |
Viresh Kumar <[email protected]> |
cpufreq: Move dev_pm_opp_{init|free}_cpufreq_table() to pm_opp.h
Move the declaration of functions defined in the OPP core to pm_opp.h. These were added to cpufreq.h as it was the only user of the A
cpufreq: Move dev_pm_opp_{init|free}_cpufreq_table() to pm_opp.h
Move the declaration of functions defined in the OPP core to pm_opp.h. These were added to cpufreq.h as it was the only user of the APIs, but that was a mistake perhaps. Fix it.
Signed-off-by: Viresh Kumar <[email protected]>
show more ...
|
| #
d394abcb |
| 27-Feb-2024 |
Shivnandan Kumar <[email protected]> |
cpufreq: Limit resolving a frequency to policy min/max
Resolving a frequency to an efficient one should not transgress policy->max (which can be set for thermal reason) and policy->min.
Currently,
cpufreq: Limit resolving a frequency to policy min/max
Resolving a frequency to an efficient one should not transgress policy->max (which can be set for thermal reason) and policy->min.
Currently, there is possibility where scaling_cur_freq can exceed scaling_max_freq when scaling_max_freq is an inefficient frequency.
Add a check to ensure that resolving a frequency will respect policy->min/max.
Cc: All applicable <[email protected]> Fixes: 1f39fa0dccff ("cpufreq: Introducing CPUFREQ_RELATION_E") Signed-off-by: Shivnandan Kumar <[email protected]> [ rjw: Whitespace adjustment, changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
| #
88debc69 |
| 22-Feb-2024 |
Pierre Gondois <[email protected]> |
cpufreq: Remove references to 10ms min sampling rate
A minimum sampling rate value of 10ms was introduced in: commit cef9615a853e ("[CPUFREQ] ondemand: Uncouple minimal sampling rate from HZ in NO_H
cpufreq: Remove references to 10ms min sampling rate
A minimum sampling rate value of 10ms was introduced in: commit cef9615a853e ("[CPUFREQ] ondemand: Uncouple minimal sampling rate from HZ in NO_HZ case")
The use of this value was removed in: commit ed4676e25463 ("cpufreq: Replace "max_transition_latency" with "dynamic_switching"")
Remove: - a comment referencing this value - an unused macro associated to this value
Signed-off-by: Pierre Gondois <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
| #
0f289828 |
| 29-Jan-2024 |
Krzysztof Kozlowski <[email protected]> |
cpufreq: do not open-code of_phandle_args_equal()
Use newly added of_phandle_args_equal() helper to compare two of_phandle_args.
Acked-by: Viresh Kumar <[email protected]> Reviewed-by: Philip
cpufreq: do not open-code of_phandle_args_equal()
Use newly added of_phandle_args_equal() helper to compare two of_phandle_args.
Acked-by: Viresh Kumar <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Zabel <[email protected]>
show more ...
|
| #
9c4a13a0 |
| 19-Jan-2024 |
Meng Li <[email protected]> |
ACPI: cpufreq: Add highest perf change notification
Platform firmware sends notify 0x85 to inform the OS that the highest performance of a CPU has changed.
This will be used by the AMD P-state driv
ACPI: cpufreq: Add highest perf change notification
Platform firmware sends notify 0x85 to inform the OS that the highest performance of a CPU has changed.
This will be used by the AMD P-state driver to update the ranking of preferred cores and set the priority of cores accordingly.
Tested-by: Oleksandr Natalenko <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Reviewed-by: Huang Rui <[email protected]> Reviewed-by: Perry Yuan <[email protected]> Signed-off-by: Meng Li <[email protected]> Link: https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#processor-device-notification-values [ rjw: New subject, changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
|
Revision tags: v6.7, v6.7-rc8, v6.7-rc7, v6.7-rc6 |
|
| #
599457ba |
| 11-Dec-2023 |
Vincent Guittot <[email protected]> |
cpufreq: Use the fixed and coherent frequency for scaling capacity
cpuinfo.max_freq can change at runtime because of boost as an example. This implies that the value could be different from the freq
cpufreq: Use the fixed and coherent frequency for scaling capacity
cpuinfo.max_freq can change at runtime because of boost as an example. This implies that the value could be different from the frequency that has been used to compute the capacity of a CPU.
The new arch_scale_freq_ref() returns a fixed and coherent frequency that can be used to compute the capacity for a given frequency.
[ Also fix a arch_set_freq_scale() newline style wart in <linux/cpufreq.h>. ]
Signed-off-by: Vincent Guittot <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Tested-by: Lukasz Luba <[email protected]> Reviewed-by: Lukasz Luba <[email protected]> Acked-by: Viresh Kumar <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Link: https://lore.kernel.org/r/[email protected]
show more ...
|
|
Revision tags: v6.7-rc5, v6.7-rc4, v6.7-rc3, v6.7-rc2, v6.7-rc1, v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5 |
|
| #
e7a1b32e |
| 05-Oct-2023 |
Pierre Gondois <[email protected]> |
cpufreq: Rebuild sched-domains when removing cpufreq driver
The Energy Aware Scheduler (EAS) relies on the schedutil governor. When moving to/from the schedutil governor, sched domains must be rebui
cpufreq: Rebuild sched-domains when removing cpufreq driver
The Energy Aware Scheduler (EAS) relies on the schedutil governor. When moving to/from the schedutil governor, sched domains must be rebuilt to allow re-evaluating the enablement conditions of EAS. This is done through sched_cpufreq_governor_change().
Having a cpufreq governor assumes a cpufreq driver is running. Inserting/removing a cpufreq driver should trigger a re-evaluation of EAS enablement conditions, avoiding to see EAS enabled when removing a running cpufreq driver.
Rebuild the sched domains in schedutil's sugov_init()/sugov_exit(), allowing to check EAS's enablement condition whenever schedutil governor is initialized/exited from. Move relevant code up in schedutil.c to avoid a split and conditional function declaration. Rename sched_cpufreq_governor_change() to sugov_eas_rebuild_sd().
Signed-off-by: Pierre Gondois <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
|
Revision tags: v6.6-rc4, v6.6-rc3, v6.6-rc2, v6.6-rc1, v6.5 |
|
| #
218a06a7 |
| 22-Aug-2023 |
Jie Zhan <[email protected]> |
cpufreq: Support per-policy performance boost
The boost control currently applies to the whole system. However, users may prefer to boost a subset of cores in order to provide prioritized performan
cpufreq: Support per-policy performance boost
The boost control currently applies to the whole system. However, users may prefer to boost a subset of cores in order to provide prioritized performance to workloads running on the boosted cores.
Enable per-policy boost by adding a 'boost' sysfs interface under each policy path. This can be found at:
/sys/devices/system/cpu/cpufreq/policy<*>/boost
Same to the global boost switch, writing 1/0 to the per-policy 'boost' enables/disables boost on a cpufreq policy respectively.
The user view of global and per-policy boost controls should be:
1. Enabling global boost initially enables boost on all policies, and per-policy boost can then be enabled or disabled individually, given that the platform does support so.
2. Disabling global boost makes the per-policy boost interface illegal.
Signed-off-by: Jie Zhan <[email protected]> Reviewed-by: Wei Xu <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
|
Revision tags: v6.5-rc7 |
|
| #
a436ae94 |
| 16-Aug-2023 |
Liao Chang <[email protected]> |
cpufreq: Use clamp() helper macro to improve the code readability
The valid values of policy.{min, max} should be between 'min' and 'max', so use clamp() helper macro to makes cpufreq_verify_within_
cpufreq: Use clamp() helper macro to improve the code readability
The valid values of policy.{min, max} should be between 'min' and 'max', so use clamp() helper macro to makes cpufreq_verify_within_limits() easier to follow.
Signed-off-by: Liao Chang <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
| #
6a4fec4f |
| 15-Aug-2023 |
Liao Chang <[email protected]> |
cpufreq: cppc: cppc_cpufreq_get_rate() returns zero in all error cases.
The cpufreq framework used to use the zero of return value to reflect the cppc_cpufreq_get_rate() had failed to get current fr
cpufreq: cppc: cppc_cpufreq_get_rate() returns zero in all error cases.
The cpufreq framework used to use the zero of return value to reflect the cppc_cpufreq_get_rate() had failed to get current frequecy and treat all positive integer to be succeed. Since cppc_get_perf_ctrs() returns a negative integer in error case, so it is better to convert the value to zero as the return value of cppc_cpufreq_get_rate().
Signed-off-by: Liao Chang <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
show more ...
|
|
Revision tags: v6.5-rc6, v6.5-rc5, v6.5-rc4, v6.5-rc3, v6.5-rc2, v6.5-rc1, v6.4, v6.4-rc7, v6.4-rc6, v6.4-rc5 |
|
| #
b4a11fa3 |
| 29-May-2023 |
Wyes Karny <[email protected]> |
cpufreq: Fail driver register if it has adjust_perf without fast_switch
If fast_switch_possible flag is set by the scaling driver, the governor is free to select fast_switch function even if adjust_
cpufreq: Fail driver register if it has adjust_perf without fast_switch
If fast_switch_possible flag is set by the scaling driver, the governor is free to select fast_switch function even if adjust_perf is set. Some scaling drivers which use adjust_perf don't set fast_switch thinking that the governor would never fall back to fast_switch. But the governor can fall back to fast_switch even in runtime if frequency invariance is disabled due to some reason. This could crash the kernel if the driver didn't set the fast_switch function pointer.
Therefore, fail driver registration if it has adjust_perf without fast_switch.
Suggested-by: Rafael J. Wysocki <[email protected]> Suggested-by: Viresh Kumar <[email protected]> Signed-off-by: Wyes Karny <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|