WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
132166
GC should be able to remove things from the DFG worklist and cancel on-going compilations if it knows that the compilation would already be invalidated
https://bugs.webkit.org/show_bug.cgi?id=132166
Summary
GC should be able to remove things from the DFG worklist and cancel on-going ...
Filip Pizlo
Reported
2014-04-24 20:45:01 PDT
This will be fun.
Attachments
I am afraid to try running this patch
(13.27 KB, patch)
2014-04-25 19:51 PDT
,
Filip Pizlo
no flags
Details
Formatted Diff
Diff
possibly done
(14.85 KB, patch)
2014-04-26 20:49 PDT
,
Filip Pizlo
no flags
Details
Formatted Diff
Diff
more
(18.18 KB, patch)
2014-04-27 11:35 PDT
,
Filip Pizlo
no flags
Details
Formatted Diff
Diff
all the pieces are in place
(27.57 KB, patch)
2014-04-27 12:59 PDT
,
Filip Pizlo
no flags
Details
Formatted Diff
Diff
might actually be done
(31.73 KB, patch)
2014-04-27 15:03 PDT
,
Filip Pizlo
no flags
Details
Formatted Diff
Diff
and now, plans are cancellable at *any* time
(32.57 KB, patch)
2014-04-27 18:38 PDT
,
Filip Pizlo
no flags
Details
Formatted Diff
Diff
the patch
(34.17 KB, patch)
2014-04-27 20:26 PDT
,
Filip Pizlo
oliver
: review+
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Filip Pizlo
Comment 1
2014-04-25 19:51:32 PDT
Created
attachment 230233
[details]
I am afraid to try running this patch
Filip Pizlo
Comment 2
2014-04-26 20:49:39 PDT
Created
attachment 230253
[details]
possibly done
Filip Pizlo
Comment 3
2014-04-26 22:08:32 PDT
This appears to help but the fact that we may have a running plan hurts us. It would be even cooler if we could cancel the running plans.
Filip Pizlo
Comment 4
2014-04-27 11:35:19 PDT
Created
attachment 230262
[details]
more Adding cancellation to DFG::Safepoint
Filip Pizlo
Comment 5
2014-04-27 12:59:49 PDT
Created
attachment 230265
[details]
all the pieces are in place
Filip Pizlo
Comment 6
2014-04-27 15:03:45 PDT
Created
attachment 230269
[details]
might actually be done
Filip Pizlo
Comment 7
2014-04-27 17:48:01 PDT
***
Bug 132236
has been marked as a duplicate of this bug. ***
Filip Pizlo
Comment 8
2014-04-27 18:38:01 PDT
Created
attachment 230273
[details]
and now, plans are cancellable at *any* time There is no escape from the GC cancellation monster.
Filip Pizlo
Comment 9
2014-04-27 20:26:26 PDT
Created
attachment 230276
[details]
the patch
WebKit Commit Bot
Comment 10
2014-04-27 20:29:32 PDT
Attachment 230276
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:127: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] Total errors found: 1 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Oliver Hunt
Comment 11
2014-04-28 09:24:45 PDT
Comment on
attachment 230276
[details]
the patch yay!
Mark Hahnenberg
Comment 12
2014-04-28 09:56:35 PDT
Comment on
attachment 230276
[details]
the patch View in context:
https://bugs.webkit.org/attachment.cgi?id=230276&action=review
What are some good stress tests for this stuff? gbemu? Our compiler-heavy benchmarks on platforms with <= 2 cores? Maybe something with a bunch of workers all doing compilation?
> Source/JavaScriptCore/dfg/DFGSafepoint.cpp:105 > + return true; // We were cancelled during a previous GC, so let's not mess with it this time around - pretend it's live and move on.
I don't understand this. Can you elaborate?
> Source/JavaScriptCore/dfg/DFGWorklist.cpp:272 > + Deque<RefPtr<Plan>> newQueue; > + while (!m_queue.isEmpty()) { > + RefPtr<Plan> plan = m_queue.takeFirst(); > + if (plan->stage != Plan::Cancelled) > + continue; > + newQueue.append(plan); > + } > + m_queue.swap(newQueue);
Hmm, I'm confused by this code. What I see is: (1) Create a new queue with all of the plans whose stage == Cancelled. (2) Replace the old work queue with just the new queue of cancelled items. I would think we would want to throw away the Cancelled plans and keep the non-cancelled ones. Is this what we're doing and I'm just being dense?
> Source/JavaScriptCore/heap/Heap.cpp:638 > + GCPHASE(FinalizerDFGWorklists);
s/FinalizerDFGWorklists/FinalizeDFGWorklists/ ?
Filip Pizlo
Comment 13
2014-04-28 11:31:37 PDT
(In reply to
comment #12
)
> (From update of
attachment 230276
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=230276&action=review
> > What are some good stress tests for this stuff? gbemu? Our compiler-heavy benchmarks on platforms with <= 2 cores? Maybe something with a bunch of workers all doing compilation?
Our stress testing infrastructure can already do this, more-or-less.
> > > Source/JavaScriptCore/dfg/DFGSafepoint.cpp:105 > > + return true; // We were cancelled during a previous GC, so let's not mess with it this time around - pretend it's live and move on. > > I don't understand this. Can you elaborate?
The GC doesn't remove safepoints. The GC cannot force forward progress in the compiler thread. So, after we cancel the plan associated with a safepoint (i.e. cancel the safepoint), a subsequent GC may still see the same safepoint - in a cancelled state - with a cancelled plan. This code gracefully ignores such safepoints since there is nothing left to do for them and they do not reference any GC memory anymore.
> > > Source/JavaScriptCore/dfg/DFGWorklist.cpp:272 > > + Deque<RefPtr<Plan>> newQueue; > > + while (!m_queue.isEmpty()) { > > + RefPtr<Plan> plan = m_queue.takeFirst(); > > + if (plan->stage != Plan::Cancelled) > > + continue; > > + newQueue.append(plan); > > + } > > + m_queue.swap(newQueue); > > Hmm, I'm confused by this code. What I see is: > > (1) Create a new queue with all of the plans whose stage == Cancelled. > (2) Replace the old work queue with just the new queue of cancelled items. > > I would think we would want to throw away the Cancelled plans and keep the non-cancelled ones. Is this what we're doing and I'm just being dense?
Yeah, the logic was inverted. Thanks for catching it!
> > > Source/JavaScriptCore/heap/Heap.cpp:638 > > + GCPHASE(FinalizerDFGWorklists); > > s/FinalizerDFGWorklists/FinalizeDFGWorklists/ ?
Lol I will change.
Filip Pizlo
Comment 14
2014-04-28 12:13:22 PDT
Landed in
http://trac.webkit.org/changeset/167897
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug