[Nexus 6P Android Development] nathanchance:
Alright guys, there has been a lot of talk about battery life and performance, especially with the addition of msm_hotplug here. I want to make this post to make sure people are considering the full picture when discussing what is good or not.

This isn't a traditional quad-core device

Our devices use a technology called big.LITTE, developed by ARM. Something a lot of people fail to take into account when discussing these devices is how big.LITTLE works. Traditionally, multi-core devices (like the previous Nexus, the Nexus 6) use a scheduling algorithm called symmetric multiprocessing (SMP), which treads the cores completely separately from each other. However, on a big.LITTLE device, it uses a scheduling algorithm called homogenous multiprocessing, which means the cores can talk to each other and are linked together, meaning that tasks can be migrated across them easily. With big.LITTLE devices, there are two sets of cores (either in pairs of two, like on the Snapdragon 820, or pairs of four, like on the Snapdragon 810 for our device). One set (little) uses less power but does tasks slower; the other set (big) uses more power but does tasks faster. A lot of people want to disable or not use the big cores as much because they use more power. However, this contradicts how Qualcomm and Google intend the device to work. The goal of big.LITTLE is efficiency (doing things as quickly and as low cost as possible). The way this is done is by running the basic/light tasks on the little cores and as soon as the task passes a certain threshold/load, the scheduler will move the task on to the big cores to finish it quicker as the big cores are more efficient and powerful at the cost of energy usage. This is handled in the core of the kernel, under the kernel/sched folder. There has been a lot of effort put into this, It is not good to run all of your tasks on the big cores as they do use more power; however, it is equally not good to run all of your tasks on the little cores as the little cores do tasks slower.

Race to idle

This is a very important concept when talking about any computer processor. Ultimately, the lowest power state a processor can be in when it is on is the idle state (cores running at their lowest frequency). As a result, you are always trying to get into this state, which means doing your tasks as quickly AND as efficiently as possible. The fastest way to get tasks done is to just run all of your tasks on the big cores; they are more powerful and can do things faster than the little cores. But that is not always the most efficient way to do things. By using both sets of cores, you look to get your tasks/loads done efficiently (saving both time and power). By only focusing on one set, you are ignoring the (usually) proper path to do things.

To hotplug or not to hotplug? That is the question

Ah hotplugging. The new thing around here. Let me be clear: I am not actively against or for hotplugging; I think it is something that needs to be fully explored though. Going along with what I am saying above, taking cores offline should save power as you are not using them; however, you are limiting the resources you have to get tasks done. The hotplug driver is slower than the cpufreq driver; it can take a bit for the hotplug driver to detect the loads and plug in the cores; then the cpufreq driver needs to raise the frequencies to the necessary levels. If the cores were all online, it takes less time for the tasks to be executed. Keep in mind, these time gaps are very small but every second matters when talking about efficiency.

What do I take away from this?

Realize that just trying to keep tasks on the little cores is not always the best solution. The phone is designed and the core scheduling algorithm has been heavily modified to optimize tasks between the two sets of cores and get them done as efficiently as possible. So rather than looking for profiles or solutions that use big less, look for ones that use them ideally. Or ignore everything and keep doing what has been working for you, this is just an education segment :good:

Some more reading for those curious:

https://en.wikipedia.org/wiki/ARM_big.LITTLE

https://www.arm.com/products/processors/technologies/biglittleprocessing.php