Surfaceflinger wastes cpu polling for early suspend when its not present
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro Android |
Fix Released
|
Critical
|
John Stultz |
Bug Description
Surface flinger has a thread which it uses to track if the screen is on or off that watches the earlysuspend interfaces found in /sys/power/
With 3.3+ kernels, the Android patch set dropped earlysuspend, so these files don't exist. I assume they also have changed their userland, but we'll not see that till Oct/Nov.
Since these interface files don't exist w/ 3.3+ kernels, surface flinger spends a decent amount of time trying to open the two files, printing out an error and trying again.
To try to address this, I found the patch that added the interfaces and stubbed out its dependency on the earlysuspend core, so the files exist and as far as surface flinger is concerned the display is never turned off. This avoids the spinning in userland.
summary: |
- Surfaceflinger times out on early suspend poll causing wasted compute + Surfaceflinger wastes cpu polling for early suspend when its not present |
Changed in linaro-android: | |
status: | Fix Committed → Fix Released |
Thread:
John Stultz ✆
15:01 (20 hours ago)
to me, Deepak, Jon, Thomas, Amit, Annamalai, rosenkranzer, Kejun, Patrik, Vishal, yong, Zygmunt
On 07/11/2012 12:46 PM, Zach Pfeffer wrote:
On 11 July 2012 14:45, John Stultz <email address hidden> wrote:
On 07/11/2012 12:40 PM, Deepak Saxena wrote:
On 11 July 2012 12:37, Zach Pfeffer <email address hidden> wrote:
Deepak/John
What userspace changes are you looking for?
Basically we want to remove the polling calls from userspace into the
earlysuspend APIs. This is the best long-term solution and we could
maybe just give it the code to Google to integrate into the next
release.
Well, that might be optimistic, as I suspect they already have something in
place.
But basically while I'm working on the kernel shim side, it may be good to
work this from both ends.
What device does it poll?
Looking at Tixy's change to remove the warning messages: review. android. git.linaro. org/#change, 1745
http://
See boolDisplayHard wareBase: :DisplayEventTh read::threadLoo p()
http:// source- android. frandroid. com/frameworks/ base/services/ surfaceflinger/ DisplayHardware /DisplayHardwar eBase.cpp
I'm guessing if we modified Tixy's change to not just return but to sleep for 10 seconds before doing so, it likely will provide similar behavior to what I'm planning.