[Android Software/Hacking General [Developers Only]] garyd9:
I ended up in a discussion with someone about samsung's kernel code that dynamically offlines the secondary core in the exynos processor. To try and prove my point, I spent a couple hours with kmsg and used a bit of kernel magic to force cores on and off. I did prove a point, but it wasn't the one I expected.

Contrary to conventional wisdom, it appears that taking unused cores offline for the exynos processor doesn't save any power...

I'm really hoping someone can comment on this and show me where I've made a mistake in these tests. I really, really hate when I prove myself wrong. ;)

Here's my test...

2 online exynos cores use the same power as 1 online and 1 offline!

The full test results are below, and there's a certain margin of error that has to be given. The device I tested on is an active android tablet with an exynos processor, so there are certain "background" things going on such as email checks, etc.

Regardless, with display brightness maxed out and numbers offset by ~500mA (see explanation below), here are some interesting power drain numbers:

2 cores locked online:

idle: 214mA

1 max thread: 392mA (2nd core is online but idle)

1 core locked online, 1 core locked OFFLINE (locked with samsung's own pm-hotplug)

idle: 208mA

1 max thread: 394mA (2nd core is locked offline)

So what is the difference between leaving both cores online and letting the kernel offline one of them when it's not needed? There isn't any difference at all from what I can see.

Detail...

The device is attached to a USB port and the kernel programmed to pull 500mA from that port (as long as the "soc" remains below 95%.) The "BAT" kernel messages contain a value, "curr" that reflect the current (in milliamps) going into or out of the battery. The 500mA from the USB cable is fed to the system; if more power is required, it is taken from the battery (and the 'curr' will be negative showing the power being pulled from the battery in excess of 500mA.) If the 500mA from the USB cable more than meets the demands of the system, then the excess power is pushed to the battery (and 'curr' will be positive showing the power being fed into the battery.)

As an example, in these tests, if the 'curr' is -200, then the overall system is using about 700mA of current. (500 from the USB cable and 200 from the battery.) If the 'curr' is a postive 100, then the overall system is using about 400mA (500 in, 400 to the system, 100 to the battery.)

One issue with this measuring: It is measuring the drain on the battery at a given instant (not averaged.)

This was done with a custom GT-P6210 kernel with a mostly stock (some apps frozen) KL1 firmware. The processor was locked at 1200MHz by using the performance governor. Voltages were left at stock. Screen brightness was set to max and the screen "touched" every 30-40 seconds to keep it fully bright (exception near the bottom of the tests when I was curious what the display pulled.) The battery of the device was kept between 80 and 90% charged to ensure consistant charging amperage.

The processor "lock" was performed using the /sys/module/pm_hotplug/parameters/lock file. Writing a '1' to the file while either both cores were active or a single core was active. Switching from 2 cores to 1 core was done by writing 0 to the lock file, letting the device go idle, and then writing 1 to the lock file to lock it into single core mode. A control test was also performed to ensure that multiple active threads did not activate a second core or increase the power consumed beyond that used by a single thread.

---- dual core tests ----

usb charging, locked to 1200MHZ, idle, screen on (full bright) 2 processor lock:

<6>[ 919.056730] BAT : soc(83), vcell(4000mV), curr(-216mA), temp(32.3), chg(1), full(0), rechg(0), cable(1)

<6>[ 959.336086] BAT : soc(83), vcell(4000mV), curr(-220mA), temp(32.3), chg(1), full(0), rechg(0), cable(1)

<6>[ 989.346786] BAT : soc(83), vcell(4001mV), curr(-205mA), temp(32.4), chg(1), full(0), rechg(0), cable(1)

Avg: -214mA drain with BOTH cores online and only minimal activity on either of them.

usb charging, locked to 1200MHZ, 1 maxed thread (cat /dev/urandom), screen on (full bright) 2 processor lock:

<6>[ 798.756718] BAT : soc(84), vcell(3978mV), curr(-392mA), temp(32.3), chg(1), full(0), rechg(0), cable(1)

<6>[ 828.776728] BAT : soc(84), vcell(3978mV), curr(-395mA), temp(32.4), chg(1), full(0), rechg(0), cable(1)

<6>[ 858.798651] BAT : soc(84), vcell(3979mV), curr(-389mA), temp(32.4), chg(1), full(0), rechg(0), cable(1)

Avg: -392mA drain with BOTH cores online and 1 of the cores maxed out. Only minimal activity on the second core.

usb charging, locked to 1200MHZ, 2 maxed thread (cat /dev/urandom), screen on (full bright) 2 processor lock:

<6>[ 678.636706] BAT : soc(84), vcell(3965mV), curr(-544mA), temp(32.3), chg(1), full(0), rechg(0), cable(1)

<6>[ 708.671712] BAT : soc(84), vcell(3962mV), curr(-543mA), temp(32.4), chg(1), full(0), rechg(0), cable(1)

<6>[ 738.711725] BAT : soc(84), vcell(3960mV), curr(-555mA), temp(32.5), chg(1), full(0), rechg(0), cable(1)

Avg: -547mA drain with BOTH cores online and BOTH cores maxed out.

---- single core tests ----

usb charging, locked to 1200MHZ, idle, screen on (full bright) 1 processor lock:

<6>[ 1208.160803] BAT : soc(83), vcell(4000mV), curr(-207mA), temp(32.3), chg(1), full(0), rechg(0), cable(1)

<6>[ 1238.193945] BAT : soc(83), vcell(3998mV), curr(-212mA), temp(32.4), chg(1), full(0), rechg(0), cable(1)

<6>[ 1268.231466] BAT : soc(83), vcell(3998mV), curr(-205mA), temp(32.4), chg(1), full(0), rechg(0), cable(1)

Avg: -208mA drain with only ONE core online and only minimal activity on it.

usb charging, locked to 1200MHZ, 1 maxed thread (cat /dev/urandom), screen on (full bright) 1 processor lock:

<6>[ 1598.818708] BAT : soc(82), vcell(3970mV), curr(-391mA), temp(32.7), chg(1), full(0), rechg(0), cable(1)

<6>[ 1628.862098] BAT : soc(82), vcell(3967mV), curr(-399mA), temp(32.7), chg(1), full(0), rechg(0), cable(1)

<6>[ 1658.901275] BAT : soc(82), vcell(3966mV), curr(-393mA), temp(32.8), chg(1), full(0), rechg(0), cable(1)

Avg: -394mA drain with only ONE core online and that core maxed out.

CONTROL and SANITY TESTS:

usb charging, locked to 1200MHz, 2 maxed thread (cat /dev/urandom), screen on (full bright) 1 processor lock:

(This was mostly a control test to ensure that only one processor was being

used.)

<6>[ 2144.689687] BAT : soc(82), vcell(3976mV), curr(-386mA), temp(31.8), chg(1), full(0), rechg(0), cable(1)

<6>[ 2174.751884] BAT : soc(82), vcell(3971mV), curr(-389mA), temp(31.9), chg(1), full(0), rechg(0), cable(1)

<6>[ 2205.090748] BAT : soc(82), vcell(3969mV), curr(-387mA), temp(31.9), chg(1), full(0), rechg(0), cable(1)

Avg: -387mA drain with only ONE core online and that core doing double duty. (this doesn't show us anything other than that only a single core was being used)

usb charging, locked to 1200MHz, 2maxed threads, screen OFF, 1 processor lock:

(note: display turned off!)

<6>[ 1993.881881] BAT : soc(82), vcell(4043mV), curr(182mA), temp(31.8), chg(1), full(0), rechg(0), cable(1)

<6>[ 2023.936881] BAT : soc(82), vcell(4045mV), curr(181mA), temp(31.7), chg(1), full(0), rechg(0), cable(1)

<6>[ 2053.986909] BAT : soc(82), vcell(4044mV), curr(181mA), temp(31.7), chg(1), full(0), rechg(0), cable(1)

usb charging, locked to 1200MHz, idle, screen OFF, 1 processor lock:

<6>[ 2910.782709] BAT : soc(83), vcell(4078mV), curr(370mA), temp(30.0), chg(1), full(0), rechg(0), cable(1)

<6>[ 2940.807429] BAT : soc(83), vcell(4080mV), curr(367mA), temp(29.9), chg(1), full(0), rechg(0), cable(1)

<6>[ 2970.841380] BAT : soc(83), vcell(4080mV), curr(369mA), temp(29.8), chg(1), full(0), rechg(0), cable(1)

(so, the display is pulling between 550mA and 590mA)