Parallel wasm compilation makes assumptions about the number of helper threads
Categories
(Core :: JavaScript: WebAssembly, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(3 files, 1 obsolete file)
Parallel wasm compilation depends on being able to run a master task that generates work at the same times as least one other task to consume the work, otherwise we can deadlock. Currently we always create at least two threads when the helper thread system is in use, but when we move to using an external thread pool that will no longer be the case.
We should check the number of threads before started parallel compilation. The helper thread system will ensure that the number of threads reported is correct when using an external thread pool.
Assignee | ||
Comment 1•4 years ago
|
||
This adds a check that there is more than one helper thread before starting
parallel compilation. It also changes the number of helper threads created so
there's only a single thread on unicore systems, which will be the case when
using the external thread pool.
Depends on D116220
Assignee | ||
Comment 2•4 years ago
|
||
This won't necessarily be true when using an external thread pool.
The maximum number of Wasm tasks is now limited by the number of cores though.
Comment 5•4 years ago
|
||
Assignee | ||
Comment 6•4 years ago
|
||
It seems that skipping parallel Wasm compliation when there's only a single thread is not enough to make this work. There are are still deadlocks when waiting for off-thread promise helper tasks with the previous patches in this bug.
Maybe a better approach is to make the XPCOM pool more like the current JS helper thread system and ensure that there are at least two threads at all times. This would also reduce the chance of performance regressions when switching over.
Updated•4 years ago
|
Assignee | ||
Comment 7•4 years ago
|
||
Currently parallel Wasm compilation requires at least two threads for
architectural reasons. This patch updates the TaskController thread policy such
that there are always two threads available, even on single core systems.
Assignee | ||
Comment 8•4 years ago
|
||
Depends on D116620
Comment 10•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ade4570ab563
https://hg.mozilla.org/mozilla-central/rev/9bc99e4fcbff
https://hg.mozilla.org/mozilla-central/rev/31567d7bd975
Description
•