aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_ondemand.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2006-09-05[CPUFREQ] Fix sparse warning in ondemandDave Jones1-1/+1
drivers/cpufreq/cpufreq_ondemand.c:323:2: warning: Using plain integer as NULL pointer Signed-off-by: Dave Jones <davej@redhat.com>
2006-08-14[CPUFREQ] make drivers/cpufreq/cpufreq_ondemand.c:powersave_bias_target() staticAdrian Bunk1-2/+3
This patch makes the needlessly global powersave_bias_target() static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Dave Jones <davej@redhat.com>
2006-08-11[CPUFREQ][2/2] ondemand: updated add powersave_bias tunableAlexey Starikovskiy1-17/+140
ondemand selects the minimum frequency that can retire a workload with negligible idle time -- ideally resulting in the highest performance/power efficiency with negligible performance impact. But on some systems and some workloads, this algorithm is more performance biased than necessary, and de-tuning it a bit to allow some performance impact can save measurable power. This patch adds a "powersave_bias" tunable to ondemand to allow it to reduce its target frequency by a specified percent. By default, the powersave_bias is 0 and has no effect. powersave_bias is in units of 0.1%, so it has an effective range of 1 through 1000, resulting in 0.1% to 100% impact. In practice, users will not be able to detect a difference between 0.1% increments, but 1.0% increments turned out to be too large. Also, the max value of 1000 (100%) would simply peg the system in its deepest power saving P-state, unless the processor really has a hardware P-state at 0Hz:-) For example, If ondemand requests 2.0GHz based on utilization, and powersave_bias=100, this code will knock 10% off the target and seek a target of 1.8GHz instead of 2.0GHz until the next sampling. If 1.8 is an exact match with an hardware frequency we use it, otherwise we average our time between the frequency next higher than 1.8 and next lower than 1.8. Note that a user or administrative program can change powersave_bias at run-time depending on how they expect the system to be used. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi at intel.com> Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy at intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2006-08-11[CPUFREQ][1/2] ondemand: updated tune for hardware coordinationAlexey Starikovskiy1-5/+8
Try to make dbs_check_cpu() call on all CPUs at the same jiffy. This will help when multiple cores share P-states via Hardware Coordination. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi at intel.com> Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy at intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2006-07-26[PATCH] Reorganize the cpufreq cpu hotplug locking to not be totally bizareArjan van de Ven1-2/+2
The patch below moves the cpu hotplugging higher up in the cpufreq layering; this is needed to avoid recursive taking of the cpu hotplug lock and to otherwise detangle the mess. The new rules are: 1. you must do lock_cpu_hotplug() around the following functions: __cpufreq_driver_target __cpufreq_governor (for CPUFREQ_GOV_LIMITS operation only) __cpufreq_set_policy 2. governer methods (.governer) must NOT take the lock_cpu_hotplug() lock in any way; they are called with the lock taken already 3. if your governer spawns a thread that does things, like calling __cpufreq_driver_target, your thread must honor rule #1. 4. the policy lock and other cpufreq internal locks nest within the lock_cpu_hotplug() lock. I'm not entirely happy about how the __cpufreq_governor rule ended up (conditional locking rule depending on the argument) but basically all callers pass this as a constant so it's not too horrible. The patch also removes the cpufreq_governor() function since during the locking audit it turned out to be entirely unused (so no need to fix it) The patch works on my testbox, but it could use more testing (otoh... it can't be much worse than the current code) Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-23[cpufreq] ondemand: make shutdown sequence more robustLinus Torvalds1-6/+10
Shutting down the ondemand policy was fraught with potential problems, causing issues for SMP suspend (which wants to hot- unplug) all but the last CPU. This should fix at least the worst problems (divide-by-zero and infinite wait for the workqueue to shut down). Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-30[CPUFREQ] Misc cleanups in ondemand.Venkatesh Pallipadi1-31/+19
Misc cleanups in ondemand. Should have zero functional impact. Also adding Alexey as author. Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2006-06-30[CPUFREQ] Make ondemand sampling per CPU and remove the mutex usage in sampling path.Venkatesh Pallipadi1-40/+32
Make ondemand sampling per CPU and remove the mutex usage in sampling path. Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2006-06-30[CPUFREQ] Remove slowdown from ondemand sampling path.Venkatesh Pallipadi1-98/+40
Remove slowdown from ondemand sampling path. This reduces the code path length in dbs_check_cpu() by half. slowdown was not used by ondemand by default. If there are any user level tools that were using this tunable, they may report error now. Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2006-06-23[PATCH] cpufreq build fixAndrew Morton1-0/+1
drivers/cpufreq/cpufreq_ondemand.c: In function 'do_dbs_timer': drivers/cpufreq/cpufreq_ondemand.c:374: warning: implicit declaration of function 'lock_cpu_hotplug' drivers/cpufreq/cpufreq_ondemand.c:381: warning: implicit declaration of function 'unlock_cpu_hotplug' drivers/cpufreq/cpufreq_conservative.c: In function 'do_dbs_timer': drivers/cpufreq/cpufreq_conservative.c:425: warning: implicit declaration of function 'lock_cpu_hotplug' drivers/cpufreq/cpufreq_conservative.c:432: warning: implicit declaration of function 'unlock_cpu_hotplug' Cc: Dave Jones <davej@codemonkey.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-21[CPUFREQ] Fix ondemand vs suspend deadlockVenkatesh Pallipadi1-0/+12
Rootcaused the bug to a deadlock in cpufreq and ondemand. Due to non-existent ordering between cpu_hotplug lock and dbs_mutex. Basically a race condition between cpu_down() and do_dbs_timer(). cpu_down() flow: * cpu_down() call for CPU 1 * Takes hot plug lock * Calls pre down notifier * cpufreq notifier handler calls cpufreq_driver_target() which takes cpu_hotplug lock again. OK as cpu_hotplug lock is recursive in same process context * CPU 1 goes down * Calls post down notifier * cpufreq notifier handler calls ondemand event stop which takes dbs_mutex So, cpu_hotplug lock is taken before dbs_mutex in this flow. do_dbs_timer is triggerred by a periodic timer event. It first takes dbs_mutex and then takes cpu_hotplug lock in cpufreq_driver_target(). Note the reverse order here compared to above. So, if this timer event happens at right moment during cpu_down, system will deadlok. Attached patch fixes the issue for both ondemand and conservative. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2006-05-08[PATCH] x86_64: Move ondemand timer into own work queueAndi Kleen1-8/+20
Taking the cpu hotplug semaphore in a normal events workqueue is unsafe because other tasks can wait for any workqueues with it hold. This results in a deadlock. Move the DBS timer into its own work queue which is not affected by other work queue flushes to avoid this. Has been acked by Venkatesh. Cc: venkatesh.pallipadi@intel.com Cc: cpufreq@lists.linux.org.uk Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-26[PATCH] cpufreq_ondemand: add range checkDominik Brodowski1-0/+3
Assert that cpufreq_target is, at least, called with the minimum frequency allowed by this policy, not something lower. It triggered problems on ARM. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-26[PATCH] cpufreq_ondemand: keep ignore_nice_load value when it is reselectedEric Piel1-2/+1
Keep the value of ignore_nice_load of the ondemand governor even after the governor has been deselected and selected back. This is the behavior of the other exported values of the ondemand governor and it's much more user-friendly. Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-26[PATCH] cpufreq_ondemand: Warn if it cannot run due to too long transition latencyEric Piel1-1/+4
Display a warning if the ondemand governor can not be selected due to a transition latency of the cpufreq driver which is too long. Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-02-28[CPUFREQ] Lots of whitespace & CodingStyle cleanup.Dave Jones1-43/+43
Signed-off-by: Dave Jones <davej@redhat.com>
2006-01-18[CPUFREQ] Convert drivers/cpufreq semaphores to mutexes.akpm@osdl.org1-20/+21
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Jones <davej@redhat.com>
2005-12-01[PATCH] cpufreq_conservative/ondemand: invert meaning of 'ignore nice'Alexander Clouter1-5/+5
The use of the 'ignore_nice' sysfs file is confusing to anyone using it. This removes the sysfs file 'ignore_nice' and in its place creates a 'ignore_nice_load' entry that defaults to '0'; meaning nice'd processes _are_ counted towards the 'business' calculation. WARNING: this obvious breaks any userland tools that expected ignore_nice' to exist, to draw attention to this fact it was concluded on the mailing list that the entry should be removed altogether so the userland app breaks and so the author can build simple to detect workaround. Having said that it seems currently very few tools even make use of this functionality; all I could find was a Gentoo Wiki entry. Signed-off-by: Alexander Clouter <alex-kernel@digriz.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Jones <davej@redhat.com>
2005-09-20[CPUFREQ] Avoid the ondemand cpufreq governor to use a too high frequency for stats.Dave Jones1-6/+12
The problem is in the ondemand governor, there is a periodic measurement of the CPU usage. This CPU usage is updated by the scheduler after every tick (basically, by adding 1 either to "idle" or to "user" or to "system"). So if the frequency of the governor is too high, the stat will be meaningless (as mostly no number have changed). So this patch checks that the measurements are separated by at least 10 ticks. It means that by default, stats will have about 5% error (20 ticks). Of course those numbers can be argued but, IMHO, they look sane. The patch also includes a small clean-up to check more explictly the result of the conversion from ns to µs being null. Let's note that (on x86) this has never been really needed before 2.6.13 because HZ was always 1000. Now that HZ can be 100, some CPU might be affected by this problem. For instance when HZ=100, the centrino ,which has a 10µs transition latency, would lead to the governor allowing to read stats every tick (10ms)! Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Dave Jones <davej@redhat.com>
2005-05-31[CPUFREQ] ondemand governor default sampling downfactor as 1Dave Jones1-1/+5
[PATCH] [5/5] ondemand governor default sampling downfactor as 1 Make default sampling downfactor 1. This works better with earlier auto downscaling change in ondemand governor. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2005-05-31[CPUFREQ] ondemand governor automatic downscalingDave Jones1-92/+25
[PATCH] [4/5] ondemand governor automatic downscaling Here is a change of policy for the ondemand governor. The modification concerns the frequency downscaling. Instead of decreasing to a lower frequency when the CPU usage is under 20%, this new policy automatically scales to the optimal frequency. The optimal frequency being the lowest frequency which provides enough power to not trigger the upscaling policy. Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2005-05-31[CPUFREQ] ondemand,conservative governor idle_tick clean-upDave Jones1-21/+5
[PATCH] [3/5] ondemand,conservative governor idle_tick clean-up Ondemand and conservative governor clean-up, it factorises the idle ticks measurement. Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2005-05-31[CPUFREQ] ondemand,conservative governor store the idle ticks for all cpusDave Jones1-1/+7
[PATCH] [2/5] ondemand,conservative governor store the idle ticks for all cpus Ondemand, conservative governor did not store prev_cpu_idle_up into prev_cpu_idle_down for other CPUs than the current CPU. Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2005-05-31[CPUFREQ] ondemand,conservative minor bug-fix and cleanupDave Jones1-38/+20
[PATCH] [1/5] ondemand,conservative minor bug-fix and cleanup Attached patch fixes some minor issues with Alexander's patch and related cleanup in both ondemand and conservative governor. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2005-05-31[CPUFREQ] Allow ondemand stepping to be changed by user.Dave Jones1-6/+36
Adds support so that the cpufreq change stepping is no longer fixed at 5% and can be changed dynamically by the user Signed-off-by: Alexander Clouter <alex-kernel@digriz.org.uk> Signed-off-by: Dave Jones <davej@redhat.com>
2005-05-31[CPUFREQ] Prevents un-necessary cpufreq changes if we are already at min/maxDave Jones1-0/+8
Signed-off-by: Alexander Clouter <alex-kernel@digriz.org.uk> Signed-off-by: Dave Jones <davej@redhat.com>
2005-05-31[CPUFREQ] Add support to cpufreq_ondemand to ignore 'nice' cpu timeDave Jones1-4/+62
Signed-off-by: Alexander Clouter <alex-kernel@digriz.org.uk> Signed-off-by: Dave Jones <davej@redhat.com>
2005-05-31[CPUFREQ] make cpufreq_gov_dbs staticDave Jones1-2/+1
This patch makes a needlessly global and EXPORT_SYMBOL'ed struct static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Dave Jones <davej@redhat.com>
2005-05-31[CPUFREQ] ondemand: trivial clean-upsDave Jones1-8/+6
Trivial ondemand governor clean-ups: - change from sampling_rate_in_HZ() to the official function usecs_to_jiffies(). - use for_each_online_cpu() to instead of using "if (cpu_online(i))" Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Dave Jones <davej@redhat.com>
2005-04-16Linux-2.6.12-rc2Linus Torvalds1-0/+491
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!