Bug 120012

Summary: 100% cpu usage for "transition: opacity" animation
Product: WebKit Reporter: Luciano Wolf <luciano.wolf>
Component: WebKit2Assignee: Luciano Wolf <luciano.wolf>
Status: CLOSED FIXED    
Severity: Normal CC: cmarcelo, commit-queue, dino, hugo.lima, jb.seo, jturcotte, luiz, noam, sergio, simon.fraser, zeno
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://www.webkit.org/blog-files/leaves/
Attachments:
Description Flags
Proposed fix - WIP - doesn't include ChangeLog yet.
none
Patch none

Description Luciano Wolf 2013-08-19 10:01:48 PDT
Created attachment 209095 [details]
Proposed fix - WIP - doesn't include ChangeLog yet.

While running leaves demo, the CPU tops at 100% for WebProcess. Even simple examples like LayoutTests/compositing/repaint/opacity-between-absolute.html does the same.

Doing some research I've found that CoordinatedLayerTreeHost::scheduleAnimation() does set a timer for animation and right after that it schedules again the same timer with 0. This behavior could be avoided if we call scheduleLayerFlush() before m_layerFlushTimer.startOneShot(m_coordinator->nextAnimationServiceTime()).

I've detected this issue on NIX port, but I wasn't able to compile Qt, GTK or EFL.
Comment 1 JeongBong Seo 2013-08-20 15:39:55 PDT
It also detected and resolved by your idea with Qt port.
Comment 2 Luciano Wolf 2013-08-27 12:23:08 PDT
So, is this patch useful? Should I updated it with ChangeLog info and ask for review?
Comment 3 Noam Rosenthal 2013-08-27 12:59:55 PDT
(In reply to comment #2)
> So, is this patch useful? Should I updated it with ChangeLog info and ask for review?

Yes please!
Comment 4 Luciano Wolf 2013-08-27 13:44:59 PDT
Created attachment 209793 [details]
Patch
Comment 5 JeongBong Seo 2013-08-27 15:13:59 PDT
I added a reivew as a comment. (Because, I don't have the auth.)

Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:399
>      scheduleLayerFlush();

I think, scheduleLayerFlush() at this moment is meaningless.
How about erase that and insert below?

if(!m_layerFlushSchedulingEnabled)
    return;
Comment 6 WebKit Commit Bot 2013-08-27 15:22:11 PDT
Comment on attachment 209793 [details]
Patch

Clearing flags on attachment: 209793

Committed r154711: <http://trac.webkit.org/changeset/154711>
Comment 7 WebKit Commit Bot 2013-08-27 15:22:13 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Luciano Wolf 2013-08-29 04:10:42 PDT
(In reply to comment #5)
> I added a reivew as a comment. (Because, I don't have the auth.)
> 
> Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:399
> >      scheduleLayerFlush();
> 
> I think, scheduleLayerFlush() at this moment is meaningless.
> How about erase that and insert below?
> 
> if(!m_layerFlushSchedulingEnabled)
>     return;

Sorry, I missed your comment among commit messages :)

I'll test and provide an updated patch. Thanks for your suggestion.