01 Apr, 2013
8 commits
-
Use an inline function to evaluate freq_target to avoid duplicate code.
Also, define a macro for the default frequency step.
Signed-off-by: Stratos Karafotis
Acked-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki -
When we evaluate the CPU load for frequency decrease we have to compare
the load against down_threshold. There is no need to subtract 10 points
from down_threshold.Instead, we have to use the default down_threshold or user's selection
unmodified.Signed-off-by: Stratos Karafotis
Acked-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki -
sampling_down_factor tunable is unused since commit
8e677ce83bf41ba9c74e5b6d9ee60b07d4e5ed93 (4 years ago).This patch restores the original functionality and documents the
tunable.Signed-off-by: Stratos Karafotis
Acked-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki -
Currently we always calculate the CPU iowait time and add it to idle time.
If we are in ondemand and we use io_is_busy, we re-calculate iowait time
and we subtract it from idle time.With this patch iowait time is calculated only when necessary avoiding
the double call to get_cpu_iowait_time_us. We use a parameter in
function get_cpu_idle_time to distinguish when the iowait time will be
added to idle time or not, without the need of keeping the prev_io_wait.Signed-off-by: Stratos Karafotis
Acked-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki -
The relation should be CPUFREQ_RELATION_L to find optimal frequency
when decreasing.Signed-off-by: Namhyung Kim
Acked-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki -
If we're on the lowest frequency, no need to calculate new freq.
Break out even earlier in this case.Signed-off-by: Namhyung Kim
Acked-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki -
Following patch has introduced per cpu timers or works for ondemand and
conservative governors.commit 2abfa876f1117b0ab45f191fb1f82c41b1cbc8fe
Author: Rickard Andersson
Date: Thu Dec 27 14:55:38 2012 +0000cpufreq: handle SW coordinated CPUs
This causes additional unnecessary interrupts on all cpus when the load is
recently evaluated by any other cpu. i.e. When load is recently evaluated by cpu
x, we don't really need any other cpu to evaluate this load again for the next
sampling_rate time.Some sort of code is present to avoid that but we are still getting timer
interrupts for all cpus. A good way of avoiding this would be to modify delays
for all cpus (policy->cpus) whenever any cpu has evaluated load.This patch does this change and some related code cleanup.
Signed-off-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki -
Currently, there can't be multiple instances of single governor_type.
If we have a multi-package system, where we have multiple instances
of struct policy (per package), we can't have multiple instances of
same governor. i.e. We can't have multiple instances of ondemand
governor for multiple packages.Governors directory in sysfs is created at /sys/devices/system/cpu/cpufreq/
governor-name/. Which again reflects that there can be only one
instance of a governor_type in the system.This is a bottleneck for multicluster system, where we want different
packages to use same governor type, but with different tunables.This patch uses the infrastructure provided by earlier patch and
implements init/exit routines for ondemand and conservative
governors.Signed-off-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki
09 Feb, 2013
1 commit
-
Fix a couple of typos in comments.
Signed-off-by: Stratos Karafotis
Acked-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki
02 Feb, 2013
5 commits
-
With the inclusion of following patches:
9f4eb10 cpufreq: conservative: call dbs_check_cpu only when necessary
772b4b1 cpufreq: ondemand: call dbs_check_cpu only when necessarycode redundancy between the conservative and ondemand governors is
introduced again, so get rid of it.[rjw: Changelog]
Signed-off-by: Viresh Kumar
Tested-by: Fabio Baltieri
Signed-off-by: Rafael J. Wysocki -
Fix governors code to set all cpu's cdbs->cpu to the the actual cpu id
and use cur_policy->cpu istead of cdbs->cpu to track current governor's
leader cpu.Reported-by: Viresh Kumar
Signed-off-by: Fabio Baltieri
Acked-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki -
Implement a generic helper function policy_is_shared() to replace the
current dbs_sw_coordinated_cpus() at cpufreq level, so that it can be
used by code other than cpufreq governors.Suggested-by: Viresh Kumar
Signed-off-by: Fabio Baltieri
Acked-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki -
Modify conservative timer to not resample CPU utilization if recently
sampled from another SW coordinated core.Signed-off-by: Fabio Baltieri
Signed-off-by: Rafael J. Wysocki -
This patch fixes a bug that occurred when we had load on a secondary CPU
and the primary CPU was sleeping. Only one sampling timer was spawned
and it was spawned as a deferred timer on the primary CPU, so when a
secondary CPU had a change in load this was not detected by the cpufreq
governor (both ondemand and conservative).This patch make sure that deferred timers are run on all CPUs in the
case of software controlled CPUs that run on the same frequency.Signed-off-by: Rickard Andersson
Signed-off-by: Fabio Baltieri
Signed-off-by: Rafael J. Wysocki
15 Nov, 2012
2 commits
-
Initially ondemand governor was written and then using its code conservative
governor is written. It used a lot of code from ondemand governor, but copy of
code was created instead of using the same routines from both governors. Which
increased code redundancy, which is difficult to manage.This patch is an attempt to move common part of both the governors to
cpufreq_governor.c file to come over above mentioned issues.This shouldn't change anything from functionality point of view.
Signed-off-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki -
Multiple cpufreq governers have defined similar get_cpu_idle_time_***()
routines. These routines must be moved to some common place, so that all
governors can use them.So moving them to cpufreq_governor.c, which seems to be a better place for
keeping these routines.Signed-off-by: Viresh Kumar
Signed-off-by: Rafael J. Wysocki
03 Oct, 2012
1 commit
-
Pull power management updates from Rafael J Wysocki:
- Improved system suspend/resume and runtime PM handling for the SH
TMU, CMT and MTU2 clock event devices (also used by ARM/shmobile).- Generic PM domains framework extensions related to cpuidle support
and domain objects lookup using names.- ARM/shmobile power management updates including improved support for
the SH7372's A4S power domain containing the CPU core.- cpufreq changes related to AMD CPUs support from Matthew Garrett,
Andre Przywara and Borislav Petkov.- cpu0 cpufreq driver from Shawn Guo.
- cpufreq governor fixes related to the relaxing of limit from Michal
Pecio.- OMAP cpufreq updates from Axel Lin and Richard Zhao.
- cpuidle ladder governor fixes related to the disabling of states from
Carsten Emde and me.- Runtime PM core updates related to the interactions with the system
suspend core from Alan Stern and Kevin Hilman.- Wakeup sources modification allowing more helper functions to be
called from interrupt context from John Stultz and additional
diagnostic code from Todd Poynor.- System suspend error code path fix from Feng Hong.
Fixed up conflicts in cpufreq/powernow-k8 that stemmed from the
workqueue fixes conflicting fairly badly with the removal of support for
hardware P-state chips. The changes were independent but somewhat
intertwined.* tag 'pm-for-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (76 commits)
Revert "PM QoS: Use spinlock in the per-device PM QoS constraints code"
PM / Runtime: let rpm_resume() succeed if RPM_ACTIVE, even when disabled, v2
cpuidle: rename function name "__cpuidle_register_driver", v2
cpufreq: OMAP: Check IS_ERR() instead of NULL for omap_device_get_by_hwmod_name
cpuidle: remove some empty lines
PM: Prevent runtime suspend during system resume
PM QoS: Use spinlock in the per-device PM QoS constraints code
PM / Sleep: use resume event when call dpm_resume_early
cpuidle / ACPI : move cpuidle_device field out of the acpi_processor_power structure
ACPI / processor: remove pointless variable initialization
ACPI / processor: remove unused function parameter
cpufreq: OMAP: remove loops_per_jiffy recalculate for smp
sections: fix section conflicts in drivers/cpufreq
cpufreq: conservative: update frequency when limits are relaxed
cpufreq / ondemand: update frequency when limits are relaxed
properly __init-annotate pm_sysrq_init()
cpufreq: Add a generic cpufreq-cpu0 driver
PM / OPP: Initialize OPP table from device tree
ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp
cpufreq: Remove support for hardware P-state chips from powernow-k8
...
15 Sep, 2012
1 commit
-
Reevaluate CPU load and update frequency immediately whenever limits
are changed. Currently conservative doesn't do that when limits are
relaxed, wasting power on systems with relatively low sampling rate.Signed-off-by: Michal Pecio
Reviewed-by: Thomas Renninger
Signed-off-by: Rafael J. Wysocki
04 Sep, 2012
1 commit
-
This change initialises the cpu id field of cs_cpu_dbs_info structure in
conservative governor and keep this consistent with other governors.
Similar initialisation is present in ondemand governor.Signed-off-by: Amit Daniel Kachhap
Signed-off-by: Rafael J. Wysocki
22 Aug, 2012
1 commit
-
Initalizers for deferrable delayed_work are confused.
* __DEFERRED_WORK_INITIALIZER()
* DECLARE_DEFERRED_WORK()
* INIT_DELAYED_WORK_DEFERRABLE()Rename them to
* __DEFERRABLE_WORK_INITIALIZER()
* DECLARE_DEFERRABLE_WORK()
* INIT_DEFERRABLE_WORK()This patch doesn't cause any functional changes.
Signed-off-by: Tejun Heo
20 Dec, 2011
1 commit
-
Conflicts:
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_ondemand.c
drivers/macintosh/rack-meter.c
fs/proc/stat.c
fs/proc/uptime.c
kernel/sched/core.c
15 Dec, 2011
1 commit
-
Make cputime_t and cputime64_t nocast to enable sparse checking to
detect incorrect use of cputime. Drop the cputime macros for simple
scalar operations. The conversion macros are still needed.Signed-off-by: Martin Schwidefsky
06 Dec, 2011
1 commit
-
This patch changes fields in cpustat from a structure, to an
u64 array. Math gets easier, and the code is more flexible.Signed-off-by: Glauber Costa
Reviewed-by: KAMEZAWA Hiroyuki
Cc: Linus Torvalds
Cc: Andrew Morton
Cc: Paul Tuner
Signed-off-by: Peter Zijlstra
Link: http://lkml.kernel.org/r/1322498719-2255-2-git-send-email-glommer@parallels.com
Signed-off-by: Ingo Molnar
08 Sep, 2011
1 commit
-
update_ts_time_stat currently updates idle time even if we are in
iowait loop at the moment. The only real users of the idle counter
(via get_cpu_idle_time_us) are CPU governors and they expect to get
cumulative time for both idle and iowait times.
The value (idle_sleeptime) is also printed to userspace by print_cpu
but it prints both idle and iowait times so the idle part is misleading.Let's clean this up and fix update_ts_time_stat to account both counters
properly and update consumers of idle to consider iowait time as well.
If we do this we might use get_cpu_{idle,iowait}_time_us from other
contexts as well and we will get expected values.Signed-off-by: Michal Hocko
Cc: Dave Jones
Cc: Arnd Bergmann
Cc: Alexey Dobriyan
Link: http://lkml.kernel.org/r/e9c909c221a8da402c4da07e4cd968c3218f8eb1.1314172057.git.mhocko@suse.cz
Signed-off-by: Thomas Gleixner
17 Mar, 2011
4 commits
-
There cannot be any concurrent access to these through
different cpu sysfs files anymore, because these tunables
are now all global (not per cpu).I still have some doubts whether some of these locks
were needed at all. Anyway, let's get rid of them.Signed-off-by: Thomas Renninger
Signed-off-by: Dave Jones
CC: cpufreq@vger.kernel.org -
Marked deprecated for quite a whilte now...
Signed-off-by: Thomas Renninger
Signed-off-by: Dave Jones
CC: cpufreq@vger.kernel.org -
Marked deprecated for quite a while now...
Signed-off-by: Thomas Renninger
Signed-off-by: Dave Jones
CC: cpufreq@vger.kernel.org -
Signed-off-by: Joe Perches
Signed-off-by: Dave Jones
26 Jan, 2011
1 commit
-
With cmwq, there's no reason for cpufreq drivers to use separate
workqueues. Remove the dedicated workqueues from cpufreq_conservative
and cpufreq_ondemand and use system_wq instead. The work items are
already sync canceled on stop, so it's already guaranteed that no work
is running on module exit.Signed-off-by: Tejun Heo
Acked-by: Dave Jones
Cc: cpufreq@vger.kernel.org
09 May, 2010
1 commit
10 Apr, 2010
1 commit
-
Multiple modules used to define those which are with identical
functionality and were needlessly replicated among the different cpufreq
drivers. Push them into the header and remove duplication.Signed-off-by: Borislav Petkov
LKML-Reference:
Reviewed-by: Thomas Renninger
Signed-off-by: H. Peter Anvin
01 Apr, 2010
1 commit
-
Instead of using the load of the last CPU in a package, use the
maximum load of all CPUs in a package.Reported-by: Jean-Christian Goussard
Signed-off-by: Dominik Brodowski
Signed-off-by: Dave Jones
25 Nov, 2009
1 commit
-
Same adustments that have been added to the ondemand recently.
Signed-off-by: Thomas Renninger
Signed-off-by: Dave Jones
18 Nov, 2009
1 commit
-
ondemand and conservative governors are messing up time units in the
code path where NO_HZ is not enabled and ignore_nice is set. The walltime
idletime stored is in jiffies and nice time calculation is happening in
microseconds.The problem was reported and diagnosed by Alexander here.
http://marc.info/?l=linux-kernel&m=125752550404513&w=2The patch below fixes this thinko.
Reported-by: Alexander Miller
Tested-by: Alexander Miller
Signed-off-by: Venkatesh Pallipadi
Signed-off-by: Dave Jones
14 Aug, 2009
1 commit
-
Conflicts:
arch/sparc/kernel/smp_64.c
arch/x86/kernel/cpu/perf_counter.c
arch/x86/kernel/setup_percpu.c
drivers/cpufreq/cpufreq_ondemand.c
mm/percpu.cConflicts in core and arch percpu codes are mostly from commit
ed78e1e078dd44249f88b1dd8c76dafb39567161 which substituted many
num_possible_cpus() with nr_cpu_ids. As for-next branch has moved all
the first chunk allocators into mm/percpu.c, the changes are moved
from arch code to mm/percpu.c.Signed-off-by: Tejun Heo
05 Aug, 2009
1 commit
-
Commit ee88415caf736b89500f16e0a545614541a45005
introduced this regression when it removed enable bit in cpu_dbs_info_s.
That added a possibility of dbs_cpufreq_notifier getting called for a
CPU that is not yet managed by conservative governor. That will happen
as the transition notifier is set as soon as one CPU switches to
conservative governor and other CPUs can get a NULL pointer dereference
without the enable bit check. Add the enable bit back again.Reported-by: Lermytte Christophe
Signed-off-by: Venkatesh Pallipadi
Signed-off-by: Dave Jones
07 Jul, 2009
2 commits
-
Redesign the locking inside conservative driver. Make dbs_mutex handle all the
global state changes inside the driver and invent a new percpu mutex
to serialize percpu timer and frequency limit change.Signed-off-by: Venkatesh Pallipadi
Signed-off-by: Dave Jones -
Commit b14893a62c73af0eca414cfed505b8c09efc613c although it was very
much needed to properly cleanup ondemand timer, opened-up a can of worms
related to locking dependencies in cpufreq.Patch here defines the need for dbs_mutex and cleans up its usage in
ondemand governor. This also resolves the lockdep warnings reported herehttp://lkml.indiana.edu/hypermail/linux/kernel/0906.1/01925.html
http://lkml.indiana.edu/hypermail/linux/kernel/0907.0/00820.htmland few others..
Signed-off-by: Venkatesh Pallipadi
Signed-off-by: Dave Jones
24 Jun, 2009
1 commit
-
Percpu variable definition is about to be updated such that all percpu
symbols including the static ones must be unique. Update percpu
variable definitions accordingly.* as,cfq: rename ioc_count uniquely
* cpufreq: rename cpu_dbs_info uniquely
* xen: move nesting_count out of xen_evtchn_do_upcall() and rename it
* mm: move ratelimits out of balance_dirty_pages_ratelimited_nr() and
rename it* ipv4,6: rename cookie_scratch uniquely
* x86 perf_counter: rename prev_left to pmc_prev_left, irq_entry to
pmc_irq_entry and nmi_entry to pmc_nmi_entry* perf_counter: rename disable_count to perf_disable_count
* ftrace: rename test_event_disable to ftrace_test_event_disable
* kmemleak: rename test_pointer to kmemleak_test_pointer
* mce: rename next_interval to mce_next_interval
[ Impact: percpu usage cleanups, no duplicate static percpu var names ]
Signed-off-by: Tejun Heo
Reviewed-by: Christoph Lameter
Cc: Ivan Kokshaysky
Cc: Jens Axboe
Cc: Dave Jones
Cc: Jeremy Fitzhardinge
Cc: linux-mm
Cc: David S. Miller
Cc: Peter Zijlstra
Cc: Steven Rostedt
Cc: Li Zefan
Cc: Catalin Marinas
Cc: Andi Kleen
15 Jun, 2009
1 commit
-
Update the documentation accordingly.
Cleanup and use printk_once.Signed-off-by: Thomas Renninger
Signed-off-by: Dave Jones