Bug 165758

Summary: GC scheduler should avoid consecutive pauses
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 149432    
Attachments:
Description Flags
the patch msaboff: review+

Description Filip Pizlo 2016-12-12 09:43:58 PST
Patch forthcoming.
Comment 1 Filip Pizlo 2016-12-12 09:46:40 PST
Created attachment 296927 [details]
the patch
Comment 2 Michael Saboff 2016-12-12 10:04:51 PST
Comment on attachment 296927 [details]
the patch

View in context: https://bugs.webkit.org/attachment.cgi?id=296927&action=review

> Source/JavaScriptCore/ChangeLog:8
> +        This factors out the scheduler from a bunch of lambdas and closed-over variables in

Should this read "... from the scheduler a bunch ..."?

> Source/JavaScriptCore/ChangeLog:14
> +        still had time during a mutator timeslice. This greatly splay-latency. I'm still testing

Fix the sentence "This greatly splay-latency."
Comment 3 Darin Adler 2016-12-12 10:05:22 PST
Comment on attachment 296927 [details]
the patch

View in context: https://bugs.webkit.org/attachment.cgi?id=296927&action=review

> Source/JavaScriptCore/heap/SpaceTimeScheduler.cpp:111
> +        std::max(
> +            m_bytesAllocatedThisCycleAtTheBeginning,
> +            static_cast<double>(heap.m_maxEdenSize)))

I like writing it this way:

    std::max<double>( ... <<no static_cast needed here>> heap.m_maxEdenSize))

> Source/JavaScriptCore/heap/SpaceTimeScheduler.h:39
> +        Decision() { }

This isn’t needed. If we leave it out, it gets generated with exactly the same contents as if we write this.
Comment 4 Filip Pizlo 2016-12-12 10:50:58 PST
(In reply to comment #3)
> Comment on attachment 296927 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=296927&action=review
> 
> > Source/JavaScriptCore/heap/SpaceTimeScheduler.cpp:111
> > +        std::max(
> > +            m_bytesAllocatedThisCycleAtTheBeginning,
> > +            static_cast<double>(heap.m_maxEdenSize)))
> 
> I like writing it this way:
> 
>     std::max<double>( ... <<no static_cast needed here>> heap.m_maxEdenSize))

That's so much better!  I never thought to specialize max explicitly.

> 
> > Source/JavaScriptCore/heap/SpaceTimeScheduler.h:39
> > +        Decision() { }
> 
> This isn’t needed. If we leave it out, it gets generated with exactly the
> same contents as if we write this.

Thanks!  I always forget the exact rules.

Maybe I wrote too much Java in a past life.
Comment 5 Filip Pizlo 2016-12-12 14:05:26 PST
(In reply to comment #2)
> Comment on attachment 296927 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=296927&action=review
> 
> > Source/JavaScriptCore/ChangeLog:8
> > +        This factors out the scheduler from a bunch of lambdas and closed-over variables in
> 
> Should this read "... from the scheduler a bunch ..."?
> 
> > Source/JavaScriptCore/ChangeLog:14
> > +        still had time during a mutator timeslice. This greatly splay-latency. I'm still testing
> 
> Fix the sentence "This greatly splay-latency."

Fixed!
Comment 6 Filip Pizlo 2016-12-12 14:07:52 PST
Landed in https://trac.webkit.org/changeset/209727
Comment 7 Filip Pizlo 2016-12-12 14:08:13 PST
*** Bug 164940 has been marked as a duplicate of this bug. ***
Comment 8 Chris Dumez 2016-12-13 13:34:40 PST
(In reply to comment #6)
> Landed in https://trac.webkit.org/changeset/209727

I am still confirming but this was likely a ~4% Speedometer regression on Mac.
Comment 9 Filip Pizlo 2016-12-13 13:38:07 PST
(In reply to comment #8)
> (In reply to comment #6)
> > Landed in https://trac.webkit.org/changeset/209727
> 
> I am still confirming but this was likely a ~4% Speedometer regression on
> Mac.

The policy change in this patch was already rolled out.
Comment 10 Chris Dumez 2016-12-13 13:40:47 PST
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #6)
> > > Landed in https://trac.webkit.org/changeset/209727
> > 
> > I am still confirming but this was likely a ~4% Speedometer regression on
> > Mac.
> 
> The policy change in this patch was already rolled out.

Could you point me to the revision of the rollout please so I can confirm the progression then?
Comment 11 Filip Pizlo 2016-12-13 13:53:23 PST
(In reply to comment #10)
> (In reply to comment #9)
> > (In reply to comment #8)
> > > (In reply to comment #6)
> > > > Landed in https://trac.webkit.org/changeset/209727
> > > 
> > > I am still confirming but this was likely a ~4% Speedometer regression on
> > > Mac.
> > 
> > The policy change in this patch was already rolled out.
> 
> Could you point me to the revision of the rollout please so I can confirm
> the progression then?

https://trac.webkit.org/changeset/209763