[Xperia Z2 Original Android Development] pec0ra:
About Fast hotplug

Motivation

I wasn't convinced by show-p's msm_mpdecision nor faux123's intelli_plug ( I don't even talk about qcom mpdecision ). I also wanted to start working on a bigger programming project to learn more about kernel developing so I decided to write my own hotplug.

Main features

I tried to make fast hotplug the lightest possible, so that it consumes the less resources possible when it is not needed (mainly at idle). One of the second goals was to make it customizable.

How to use

Deactivate qcom mpdecision (Pimp my Z1 will do this automatically when you choose fast hotplug)

Activate fast_hotplug

adb shell "echo 1 > /sys/module/fast_hotplug/parameters/fast_hotplug_enabled"

Tune it to your liking

How to configure

Unfortunately, there isn't yet any user friendly application to configure fast hotplug. The only way to configure it is to manually edit the module files with adb or a file editor.

I modified Pimp my Z1 to be compatible with fast hotplug. You can find the modified version at post 12

You can also find all the parameters at

/sys/module/fast_hotplug/parameters/

and edit them with adb command

adb shell "echo [COLOR="Navy"]<value>[/COLOR] > /sys/module/fast_hotplug/parameters/[COLOR="Navy"]<variable_name>[/COLOR]"

You can configure the following parameters :

fast_hotplug_enabled : 0 for disabled, 1 for enabled

boost_duration : Duration of boost in ms when screen is touched

threshold_to_boost : Instead of automatically pluging in cores on touch, fast hotplug checks that the load is above this threshold. This avoid cores coming online when reading file or website.

max_cpu_on : Maximum number of online cpu when screen is on

min_cpu_on : Minimum number of online cpu when screen is on

idle_threshold : Threshold under which fast_hotplug will remain almost idle and won't perform any check. This applies when only 1 core is online

plug_in_core_X_threshold : with X between 1 and 3. This is the threshold to plug in coreX.

plug_in_core_X_delay : This is the number of fast_hotplug cycles (see refresh_rate) to skip before pluging in coreX.

plug_out_core_X_threshold : Like plug_in_core_X_threshold but to plug out.

plug_out_core_X_delay

refresh_rate : Time in ms between fast hotplugs checks

screen_off_singlecore : 1 for activated, 0 for deactivated; Allows only one core to be online when screen is off.

If you are using linux, you can easily change the configuration with this small program : https://github.com/pec0ra/fast_hotplug_controller

You will probably want to create init.d script to make your configuration stay after reboot. If enough users want it, I can create an example of script.

Bugs / stability

Due to some conflicts with qcom mpdecision, it is possible that you encounter some bugs / reboots when both are enabled.

Configuration doesn't stick after reboots

Help needed

If you are a java developer (or want to learn ;) ) and want to help in developing an app (or editing an already existing one) to control the hotplug, please send me a pm :)

Please tell me your impression, your custom configuration and / or your recommendation so that I can make it better in future releases.