[Galaxy Note GT-N7000 Android Development] garyd9:
The GN uses a TI OMAP? I've never played with that processor - only intel variations, exynos and snapdragon here. The qualcomm processor is predictable, but boring. Samsung's exynos is impressive, but has the most annoying quirks.

That doesn't sound right. The kernel should be keeping the second core online for a while to prevent it going on/offline that often. That might be a bad implementation in the arch specific code.

I agree that in the example you give its inefficient. However, that's a single case and may be due to faulty code from TI and/or samsung. It also might be impacted by Google's attempt in ICS to use multiple cores.

Have you seen similar situations occur on the Note? Now you have me curious.. I'll have to boot a stock Note kernel and watch the kmsgs while starting up settings. :)

One more thing - thank you for knowing what you are doing. I've seen people pull kernel sources and just slap in patches without really understanding what the patches are doing, why the exist, and the ramifications of them. That type of person annoys me endlessly.

Edit -

Okay - here's a simple test (using a stock kernel from CF.) The device was booted and long past the media scan.. basically idle on the launcher screen. I have a 'settings' icon on the home launcher. I pressed that icon. After settings came up, I then pressed the "back" button to close settings (which causes TW to redraw.) A couple things of interest here... First, the second core comes up AFTER the drawing work is already done. I'm not sure why it came up or what it was doing. Second, the second core stays up for about 2 seconds before shutting down (time between "cpu1 on end" and "cpu1 turning off".) I'm going to run some more tests to see if its consistantly staying awake for at least the same amount of time or not. I also want to see if there are power drain measurements dumping to the sysfs or procfs.

One other thing I noticed of interest in doing this (but didn't copy the log for) was that on booting up, when the device was doing the media scan of my microSD card (with about 20GB of music files), as long as I left the device idle there would only be a single core awake at 1400MHz. The secondary core would wake up if I did something else with the device, but mostly stayed offline.

<6>[ 333.530022] smb328-charger 19-0034: smb328_get_property: smb328_get_property (2,1)
<7>[ 334.989542] [TSP] pressed
<6>[ 335.002043] max17042 9-0036: max17042_get_soc : soc(5997)
<6>[ 335.002069] max17042 9-0036: max17042_get_soc : use raw (89), soc (90)
<7>[ 335.120294] [TSP] released
<4>[ 335.233249] !@FINISH DRAWING : Starting com.android.settings
<4>[ 335.240476] !@finishDrawing is completed : Starting com.android.settings
<4>[ 335.819380] !@FINISH DRAWING : com.android.settings/com.android.settings.Settings
<4>[ 335.830529] !@finishDrawing is completed : com.android.settings/com.android.settings.Settings
<4>[ 335.987432] cpu1 turning on!
<4>[ 335.987456] >made stopper
<4>[ 336.008246] CPU1: Booted secondary processor
<7>[ 336.068278] ++ s5pv310_cpufreq_cpu_init
<4>[ 336.068359] cpu1 on end!
<4>[ 338.122723] cpu1 turning off!
<6>[ 338.182798] IRQ112 no longer affine to CPU1
<5>[ 338.183311] CPU1: shutdown
<4>[ 338.188435] cpu1 off end!
<6>[ 338.582825] sec-battery sec-battery: sec_bat_check_vf: Battery Health (1)
<6>[ 338.583592] smb328-charger 19-0034: smb328_get_charging_health : charging status A(0x02)
<6>[ 338.584316] smb328-charger 19-0034: smb328_get_charging_health : charging status B(0x00)
<6>[ 338.585039] smb328-charger 19-0034: smb328_get_charging_health : charging status C(0x05)
<6>[ 338.585103] smb328-charger 19-0034: smb328_get_property: smb328_get_property (2,1)
<7>[ 338.604779] tspdrv: ImmVibeSPI_ForceOut_AmpEnable (1)
<7>[ 338.635135] tspdrv: ImmVibeSPI_ForceOut_AmpDisable (0)
<4>[ 338.887542] !@Mali Android API Version : 7 [1329083438]
<4>[ 338.887576]
<4>[ 339.331603] !@FINISH DRAWING : com.sec.android.app.twlauncher/com.sec.android.app.twlauncher.Launcher
<4>[ 339.364787] !@finishDrawing is completed : com.sec.android.app.twlauncher/com.sec.android.app.twlauncher.Launcher
<4>[ 339.742690] cpu1 turning on!
<4>[ 339.742708] >made stopper
<4>[ 339.869816] CPU1: Booted secondary processor
<7>[ 339.943107] ++ s5pv310_cpufreq_cpu_init
<4>[ 339.943157] cpu1 on end!
<4>[ 341.957610] cpu1 turning off!
<6>[ 342.017767] IRQ112 no longer affine to CPU1
<5>[ 342.018296] CPU1: shutdown
<4>[ 342.027728] cpu1 off end!
<6>[ 343.698195] sec-battery sec-battery: sec_bat_check_vf: Battery Health (1)
<6>[ 343.698963] smb328-charger 19-0034: smb328_get_charging_health : charging status A(0x02)

Edit 2 - (translations of kernel source for the non-technical)

It appears, with the stock kernel, that the kernel waits at least 2 seconds (.5 jiffies * 4 * HZ) between turning the second core on and allowing it to turn off again. It waits at least 1/2 second (.5 jiffies * HZ) between turning off the second core and allowing it to turn back on. That prevents the constant cycling on/off of a core.

In addition, the second core is not turned off until a load average calculation is < 20% or the cores are both running <= 200MHz. The second core is not turned on until a load average calculation is > 50% _and_ the core speed is > 200MHz. (Implication being that a cpufreq governor can really mess up cpu hot plugging by either forcing the processor to 200MHz prematurely or by preventing it from stepping down to 200MHz.)

The pm_hotplug code can be locked on or off using a module pameter (/sys/module/pm_hotplug/parameters/lock) 1 will lock it, anything else will unlock it. Sadly, it doesn't seem possible to force the second core on (or off) before locking it. (So, the results might be somewhat random if you were to set this in an init.d script.)

(doing tests on a GT-P6210 that allows me to measure power drain... so far, the results are shocking)

Take care

Gary