Bug 167528

Summary: The mutator should be able to perform increments of GC work
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, commit-queue, dbates, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
work in progress
none
possibly better version
none
the patch keith_miller: review+

Description Filip Pizlo 2017-01-27 14:31:28 PST
If you don't have a lot of cores, then running the GC in a purely concurrent way can be bad: you won't make enough progress to keep pace with the mutator's allocations.

Fortunately, Riptide has most of what we need to run increments of GC work on the mutator thread. This is the most natural way to pace the mutator, since it forces the mutator to do GC work anytime it allocates.
Comment 1 Filip Pizlo 2017-01-27 14:32:29 PST
Created attachment 299962 [details]
work in progress
Comment 2 Filip Pizlo 2017-01-30 16:17:34 PST
Created attachment 300158 [details]
possibly better version
Comment 3 Filip Pizlo 2017-01-31 10:57:55 PST
Created attachment 300235 [details]
the patch
Comment 4 Keith Miller 2017-01-31 12:08:38 PST
Comment on attachment 300235 [details]
the patch

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

r=me.

> Source/JavaScriptCore/heap/SlotVisitor.cpp:552
> +            if (status == IterationStatus::Continue)
> +                break;

Using IterationStatus::Continue to signal we have no more work to do is confusing but I guess that's the pattern.

> Source/WTF/wtf/DataLog.cpp:131
> +    s_file = new (s_lockedFileData) LockedPrintStream(std::unique_ptr<FilePrintStream>(file));

oh wow...
Comment 5 Filip Pizlo 2017-01-31 12:10:22 PST
(In reply to comment #4)
> Comment on attachment 300235 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=300235&action=review
> 
> r=me.
> 
> > Source/JavaScriptCore/heap/SlotVisitor.cpp:552
> > +            if (status == IterationStatus::Continue)
> > +                break;
> 
> Using IterationStatus::Continue to signal we have no more work to do is
> confusing but I guess that's the pattern.

It's unfortunate. I will we had generators. It's actually so confusing here: we say "Continue" to tell the forEachBlah to go to the next mark stack. We do that when the mark stack we were at had no work. So, if forEachBlah returns Continue then no mark stack had work. Hence, if it says Continue, we break.

> 
> > Source/WTF/wtf/DataLog.cpp:131
> > +    s_file = new (s_lockedFileData) LockedPrintStream(std::unique_ptr<FilePrintStream>(file));
> 
> oh wow...
Comment 6 Geoffrey Garen 2017-01-31 12:31:27 PST
Comment on attachment 300235 [details]
the patch

r=me

> Source/JavaScriptCore/ChangeLog:24
> +        precise at keeping case as the new work-based incremental mode.

keeping pace

> Source/JavaScriptCore/ChangeLog:33
> +        each other is a huge splay-latency speed-up on my iPad. It's also a CDjs progression. It does
> +        progress splay-throughput, but I think that's fine (the regression is 11%, the progression is

did you mean *regress* splay-throughput?
Comment 7 Filip Pizlo 2017-01-31 12:33:04 PST
(In reply to comment #6)
> Comment on attachment 300235 [details]
> the patch
> 
> r=me
> 
> > Source/JavaScriptCore/ChangeLog:24
> > +        precise at keeping case as the new work-based incremental mode.
> 
> keeping pace

Fixed.

> 
> > Source/JavaScriptCore/ChangeLog:33
> > +        each other is a huge splay-latency speed-up on my iPad. It's also a CDjs progression. It does
> > +        progress splay-throughput, but I think that's fine (the regression is 11%, the progression is
> 
> did you mean *regress* splay-throughput?

Yes. Fixed.
Comment 8 Filip Pizlo 2017-01-31 14:33:06 PST
Landed in https://trac.webkit.org/changeset/211448