Surfaceflinger takes more that 50% of the CPU usage on the latest Android builds

Bug #1006751 reported by Zach Pfeffer
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro Android
Confirmed
High
Amit Pundir

Bug Description

ARM found this while profiling Snowball on DS-5. We suspect all platforms have this problem.

Zach Pfeffer (pfefferz)
Changed in linaro-android:
assignee: nobody → Amit Pundir (pundiramit)
importance: Undecided → High
status: New → Confirmed
status: Confirmed → New
status: New → Confirmed
milestone: none → 12.06
Revision history for this message
Bernhard Rosenkraenzer (berolinux) wrote :

Off the top of my head, I'd say this is triggered by the latest kernels: EARLYSUSPEND stuff is gone in current kernels, and surfaceflinger used to spam the logs with around 10 warnings about that per second. I'm not sure that has been fixed...

Can you confirm/deny that theory?

Revision history for this message
Amit Pundir (pundiramit) wrote :

We suspect the same EARLYSUSPEND issue here. This is supposed to be fixed in AOSP's 3.4 tree but not sure if it fixed there or not.

Zach Pfeffer (pfefferz)
Changed in linaro-android:
milestone: 12.06 → none
Revision history for this message
Yann BENIGOT (yann-benigot-w) wrote :

An quick fix to this is to add a usleep() call in the DisplayHardwareBase::DisplayEventThread::threadLoop() function in case FB_EARLYSUSPEND is missing so that the thread stops using all CPU.
With the attached patch, the threadLoop() function will only be called six times per second. Perhaps it would be possible to suspend the thread entirely when FB_EARLYSUSPEND is missing since the thread does not seem to be doing anything.

It reduced surfaceflinger's CPU usage to 5-7% with linaro-wallpaper, 0-1% without.

Revision history for this message
Yann BENIGOT (yann-benigot-w) wrote :
Revision history for this message
John Stultz (jstultz) wrote :

So what version of userland is being used here?

Since with AOSP 4.2, the suspend/display managment logic has been moved from surfaceflinger to the PowerManagerService.

See commit message here for details: https://android.googlesource.com/platform/frameworks/base/+/9630704ed3b265f008a8f64ec60a33cf9dcd3345

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.