auto_hotplug: enhancements

1) added module params so tuning an be adjusted in userspace and
debugging can easliy be enabled/disabled

/sys/module/auto_hotplug/parameters/debug
(N/Y - turn off/on debugging)

/sys/module/auto_hotplug/parameters/disable_load_threshold
(integer - load at which a CPU is disabled)

/sys/module/auto_hotplug/parameters/enable_load_threshold (integer -
load at which an extra CPU is enabled)

/sys/module/auto_hotplug/parameters/enable_all_load_threshold (integer -
load at wich all CPU's are enabled)

/sys/module/auto_hotplug/parameters/min_sampling_rate
(milliseconds, converted to jiffies at runtime)

2) lowered enable_load_threshold from 225 to 200 for a little more pep.

To-do: add get/set routines to keep values safe and in acceptable ranges

 auto_hotplug: enhancements (rev 2)

1) Added ability to change the number of sampling_periods on the fly via
sysfs (while preserving past history).

2) Added get/set for module parameters so user's can't set incorrect or
unreasonable values.

3) Tweaked defaults

4) Don't wait as long to start auto_hotplug (referenced franco's
git). Today's devices are much faster to boot however
if this code is ported to a slower core device, it may need to be
raised.

5) Debug mode tweaks
-Organize and reduce the number of line output.
-Attempt to make output more user friendly for those that aren't
reading the code.

 auto_hotplug: enhancements (rev 3)

1) Added max_online_cpus (1-4) and exposed to sysfs via a module
parameter. Once set, only allow the chosen number of cores to be
online and make sure we compensate for it in the boostpulse function.

2) Make minor tweaks to mathkid's min_online_cpus

-Don't schedule work in the parameter set, just let it be done on the
next poll iteration.

-Misc style changes so that it matches the other code I have been
adding the module.

 auto_hotplug: parameter validation for max_online_cpus

If validation fails, set max_online_cpus = CPUS_AVAILABLE instead of
"1"

 auto_hotplug: stack the deck on auto_hotplug_late_resume to get things

moving quickly again

 auto_hotplug: rev 4 - let's lean a little more towards performance.

This includes:

1) Set DEFAULT_SAMPLING_PERIODS back to 10 (from 12)

2) Set DEFAULT_ENABLE_ALL_LOAD_THRESHOLD to (100 * CPUS)

3) Finally came back and fixed "stack the deck" like I had originally
intended after the quick test.

4) Updated to revision to 4.

All Credits @motley
cpufreq: upgrade ondemand governor to latest code aurora version and
tweak some defaults.
smp: patches from mainline 3.5 to hopefully help with hotplug
efficiency

Thomas Gleixner's generic-idle patches:

smp: Add task_struct argument to __cpu_up()
Preparatory patch to make the idle thread allocation for secondary
cpus generic.
http://git.kernel.org/?p=linux/kernel/git/tip/tip.git;a=commit;h=8239c25f47d2b318156993b15f33900a86ea5e17

smp: Add generic smpboot facility
Start a new file, which will hold SMP and CPU hotplug related generic
infrastructure.
http://git.kernel.org/?p=linux/kernel/git/tip/tip.git;a=commit;h=38498a67aa2cf8c80754b8d304bfacc10bc582b5

smp: Provide generic idle thread allocation
All SMP architectures have magic to fork the idle task and to store it
for reusage when cpu hotplug is enabled. Provide a generic
infrastructure for it.
Create/reinit the idle thread for the cpu which is brought up in the
generic code and hand the thread pointer to the architecture code via
__cpu_up().
Note, that fork_idle() is called via a workqueue, because this
guarantees that the idle thread does not get a reference to a user
space VM. This can happen when the boot process did not bring up all
possible cpus and a later cpu_up() is initiated via the sysfs
interface. In that case fork_idle() would be called in the context of
the user space task and take a reference on the user space VM.
http://git.kernel.org/?p=linux/kernel/git/tip/tip.git;a=commit;h=29d5e0476e1c4a513859e7858845ad172f560389

arm: Use generic idle thread allocation
http://git.kernel.org/?p=linux/kernel/git/tip/tip.git;a=commit;h=84ec6d5796e095e2f8698bd2b5d33849ed26d9e2