cpufreq: interactive: sync it with FK

Change-Id: I00dbbccbe39bd8af53262497fb4f2e7258193e9a
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: Add max_freq_hysteresis feature

Previously known as sampling down factor, max_freq_hysteresis
extends the period that interactive governor will stay at policy->max.
This feature is to accomodate short idle periods in an otherwise very
intensive workload.

When the feature is enabled, it ensures that once a CPU goes to max
frequency, it doesn't reduce the frequency for max_freq_hysteresis
microseconds from the time it first goes to idle.

Change-Id: Ia54985cb554f63f8c22d0b554a0a0f2ed2be038f
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
cpufreq: interactive: Make window alignment optional

Make sampling window alignment optional when scheduler inputs
are not enabled.

Change-Id: If69c111a3efe219cdd1e38c1f46f03404789c0bb
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
cpufreq: interactive: Exercise hispeed settings at a policy level

If a heavy task migrates between otherwise idle CPUs in a policy during
every sample window, the above hispeed delay window for the CPUs would get
restarted for every sample window. Due to the continuous restart of above
hispeed delay window, none of the CPUs would ever pick a target frequency
higher than hispeed frequency. This causes the policy's frequency to be
stuck at hispeed freq even if the load justifies a higher frequency.

To fix this, the above high speed delay window is restarted only when the
policy frequency changes. This ensures that tasks migrating between CPUs in
a policy are handled correctly.

Also, the hispeed load/frequency heuristic is only necessary when the
information is insufficient to determine if the load on the CPU needs at
least hispeed frequency. When the policy frequency is already at or above
hispeed frequency, if the CPU load% based on policy frequency is not above
hispeed load, then the information is clearly sufficient to determine that
the load on the CPU does not need hispeed frequency.

Therefore, compute CPU load% (which is used only to compare against hispeed
load) based on policy frequency instead of CPU target frequency.

Change-Id: I1749d663949e34753ecb5c426a16563796f8b0b2
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
cpufreq: interactive: fix merge derp

Change-Id: I89795511588dd98d89158db1f84999e1653c0606
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpupower: Remove mc and smt power aware scheduler info/settings

These kernel interfaces got removed by:

commit 8e7fbcbc22c12414bcc9dfdd683637f58fb32759
Author: Peter Zijlstra <peterz@infradead.org>
Date:   Mon Jan 9 11:28:35 2012 +0100

    sched: Remove stale power aware scheduling remnants and dysfunctional knobs

No need to further keep them as userspace configurations.

Change-Id: I5bcabb16fce59120e8072325f9ae76d859fe864b
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
mako_hotplug: Add my Hotplug driver.

Change-Id: I31966aa78d141774090e3e5044c02bccf8580c9e
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: we can live with 80% threshold.

Change-Id: I7f7c8bc6f5af7e02f74c91b5235d8c3f9d324d62
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: we can now cap max freq to 1GHz on screen off.

Change-Id: I832c035aeaf7896ee3dd76253a63cbd0056a0374
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: without updating the policy nothing actually happened.

Change-Id: I3ba8c1f8d4288adcc21af9b73b95696ba09bcce3
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: make sure the notifier does not go through for every damn CPUFREQ_ADJUST otherwise it's a mess.

Change-Id: I1abbc5cd36838aeea3d74db4e24c7e72a541c00b
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: lets try this fix for the crippling sound when changing networks.

Change-Id: I56e9695aa1dd3ccc6a94b2432263bf6fe399571d
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: minor code optimisations.

Change-Id: I9cb4138141d8096d33610df3bbee9175f91d55d3
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: small fix to make sure we don't try to cpu_up(x) if x is alread online.

Change-Id: I9f2f65b04140ea74363639fbd61545d6e3e30b18
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: clean-up

* clean up the store functions using proper and modern kstrtoul

Change-Id: I258f539b37945c817a71ddd6a1371832d9d812eb
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: bugfixing

* fix a bug where cpu_smash()->cpus_cpufreq_work()->cpus_offline_work()
was being called every 100ms

Change-Id: I07fa9b95b77994bd36ba9cd3e8c93298ea42bfff
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: fix checkpatch warnings

Change-Id: I79f4bad71947c0074815e1eb6dc8482b5a219ddd
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: we can shift left here instead.

Change-Id: I29b2a1b5601248f4fa29f882e72e973694520c7a
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: fix a bug where all cores could stay indefinitely online

if userspace (either root command or an app) onlined all cores when the counter was < 10.
Fix it by querying the num_online_cpus() every sample (100ms).

Change-Id: Ia3e01e647b1d451a31e237c735445d711ac35e30
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mako_hotplug: fix a rare case where the restored frequency wouldn't be the same as when the device wen't to sleep.

Change-Id: I960307cfdcc8af494d0739309a116a7ae5b0f564
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>