Closed Bug 1377238 Opened 7 years ago Closed 7 years ago

Free finished IonBuilders off-thread

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
FinishOffThreadBuilder often shows up in profiles. Some problems here:

(1) Free is slow, and the Ion LifoAlloc usually has a number of chunks we have to free.

(2) Because most of this data was last used by the off-thread compilation thread, probably on another core, we seem to run into cache coherency issues. Cache profiling shows a ton of write misses under FinishOffThreadBuilder.

(3) While we free the builder, we keep the HelperThreadState locked so we block helper threads from taking on new tasks in the meantime.

The attached patch introduces "Ion free tasks" to destroy this data off-thread. This seems to be a noticeable perf win on some benchmarks I tried.

Jon, asking you for review because you're probably most familiar with the helper threads stuff.
Attachment #8882315 - Flags: review?(jcoppeard)
Comment on attachment 8882315 [details] [diff] [review]
Patch

Review of attachment 8882315 [details] [diff] [review]:
-----------------------------------------------------------------

Nice.
Attachment #8882315 - Flags: review?(jcoppeard) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b9422e6c4ec5
Free finished IonBuilders off-thread. r=jonco
https://hg.mozilla.org/mozilla-central/rev/b9422e6c4ec5
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Just random thought on this topic: if a lot of time is spent malloc/free'ing LifoAllocs, could there be further wins from keeping them in a free queue?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: