Closed Bug 1434622 Opened 6 years ago Closed 6 years ago

Reduce contention on the exclusive access lock by using a separate lock to protect shared script data

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(1 file)

To improve concurrency between the main thread and off-thread parsing, we should consider splitting the exclusive access lock into smaller locks to protected individual data structures where possible.

I looked at all the places this is used and as far as I can see it's used to protect:
 1. The atoms zone (atoms, the atoms table, and and various shared JIT things)
 2. The shared script data table

So the main improvement we can make here is to use a separate lock for shared script data.
Patch to use a separate lock to protect the shared script data table.
Attachment #8947129 - Flags: review?(sphink)
Comment on attachment 8947129 [details] [diff] [review]
bug1434622-script-data-lock

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

Cool. And this reduces the size of the critical section in mallocSizeOf... too.

::: js/src/vm/MutexIDs.h
@@ +11,5 @@
>  
>  // Central definition point for mutex ordering.
> +//
> +// Mutexes can only be acquired in increasing order. This prevents the
> +// possibility of deadlock.

Very helpful comment insertion, thanks.
Attachment #8947129 - Flags: review?(sphink) → review+
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/43a07eda5524
Use a separate lock to protect the shared script data table r=sfink
https://hg.mozilla.org/mozilla-central/rev/43a07eda5524
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: