Free finished IonBuilders off-thread

RESOLVED FIXED in Firefox 56

Status

()

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: jandem, Assigned: jandem)

Tracking

(Blocks: 1 bug)

unspecified
mozilla56
Points:
---

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
Posted 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+

Comment 2

2 years ago
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b9422e6c4ec5
Free finished IonBuilders off-thread. r=jonco

Comment 3

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b9422e6c4ec5
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox56: --- → fixed
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.