cpuquiet: Update averaging of nr_runnables

Doing a Exponential moving average per nr_running++/-- does not
guarantee a fixed sample rate which induces errors if there are lots of
threads being enqueued/dequeued from the rq (Linpack mt). Instead of
keeping track of the avg, the scheduler now keeps track of the integral
of nr_running and allows the readers to perform filtering on top.

Implemented a proper exponential moving average for the runnables
governor and a straight 100ms average for the balanced governor. Tweaked
the thresholds for the runnables governor to minimize latency. Also,
decreased sample_rate for the runnables governor to the absolute minimum
of 10msecs.

Updated to K3.4

Change-Id: Ia25bf8baf2a1a015ba188b2c06e551e89b16c5f8
Signed-off-by: Sai Charan Gurrappadi <sgurrappadi@nvidia.com>
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Reviewed-on: http://git-master/r/131147
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

Conflicts:
	drivers/cpuquiet/governors/balanced.c
cpuquiet: cleanup Kconfig and Makefile

Add options to enable/disable individual governors and adjust the Makefile
to only build the selected governors.

Change-Id: Ia3d36afd0f1d2e8cc622956fa0dc16c23cc9904d
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Reviewed-on: http://git-master/r/131436
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

Rebase-Id: R0353ccd8d52227302fe7a890b9805b6c9170f58c

Conflicts:
	drivers/cpuquiet/Kconfig
	drivers/cpuquiet/governors/Makefile
cpuquiet: balanced governor requires cpufreq

The balanced governor relies on cpufreq for some of its decisions. Fail
initialization if there are no cpufreq OPP tables available.

Change-Id: I5d64215d56f50d5df52c1433208b1eb40440c812
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Reviewed-on: http://git-master/r/131437
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

Rebase-Id: R03bb471218a088a816a67232861759cba2b91f38
cpuquiet: initialize runnable threads first as the default governor

Add the necessary code to initialize the runnable threads governor first when
selected as the default governor.

Change-Id: Iebbf304f3934b429d8a217011b3cb45ecddfd558
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Reviewed-on: http://git-master/r/131438
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

Rebase-Id: Rb5009930e554648a17d78edf9d8bdd17199c9c6a
cpuquiet: Update runnable gov param 20/100ms (1.25/2.25/2.5 +.5)

Sampling interval: 20ms
Window size: 100ms

Thresholds: 1.25/2.25/2.5 thread
Hysteresis: .5 thread

Bug 1050445

Change-Id: I5138bed06e6f3548ec440d2b9ee17460fc37adfb
Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-on: http://git-master/r/163105
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
cpuquiet: Make stats optional

Make the per CPU statistics a configureable option.

bug 1049625

Change-Id: I28b248bbbad89a19e8d8d69400733dfd4a2cf052
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Reviewed-on: http://git-master/r/168749
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>

Conflicts:
	drivers/cpuquiet/driver.c