Bug 180249 - The GC load balancer should not rely on a global mutex
Summary: The GC load balancer should not rely on a global mutex
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 180250
  Show dependency treegraph
 
Reported: 2017-12-01 08:32 PST by Filip Pizlo
Modified: 2017-12-03 14:21 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2017-12-01 08:32:06 PST
The Heap::m_markingMutex was a great first attempt at synchronizing a load balancer.  It's amazing how long that thing has survived.  But profiling shows that this is one of the most (and sometimes the absolute most) contended mutex in WebKit when running Speedometer.
Comment 1 Filip Pizlo 2017-12-01 08:33:10 PST
@Ryosuke: seems like we have a Speedometer perf opportunity from giving the GC a proper load balancer instead of our current single-global-lock-protecting-a-stack algorithm.

If load balancers were like 3D engines, then our GC uses the Wolfenstein 3D of load balancers.  I think we can do better.
Comment 2 Ryosuke Niwa 2017-12-03 11:55:59 PST
I guess it would be useful to know how much wall time is spent in GC during Speedometer.
Comment 3 Filip Pizlo 2017-12-03 14:21:25 PST
(In reply to Ryosuke Niwa from comment #2)
> I guess it would be useful to know how much wall time is spent in GC during
> Speedometer.

I don’t have a number, but in the past it has responded to GC optimizations and regresssions about the same way as the average of other JS benchmarks.  I just got a 1% Speedometer speedup from doing something else to the GC. 

“Time spent in GC” is not an easily-defined number because the GC is concurrent.