IOUtils uses the CPU-intensive threadpool for blocking IO
Categories
(Core :: XPCOM, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox95 | --- | fixed |
People
(Reporter: nika, Assigned: nika)
Details
Attachments
(1 file)
IOUtils dispatches to a nsISerialEventTarget from NS_CreateBackgroundTaskQueue (https://searchfox.org/mozilla-central/rev/b847c844adf49013067281d3237e7ada24325a34/dom/system/IOUtils.cpp#1537-1538), and then dispatches with InvokeAsync (https://searchfox.org/mozilla-central/rev/b847c844adf49013067281d3237e7ada24325a34/dom/system/IOUtils.cpp#1600-1607), which always calls Dispatch without flag arguments. Because of this, the NS_DISPATCH_EVENT_MAY_BLOCK flag is not set on the dispatches, despite blocking I/O being performed.
We should add a way to specify NS_DISPATCH_EVENT_MAY_BLOCK when calling InvokeAsync (perhaps an InvokeAsyncIO?) and use it in these functions.
In addition, it may be useful in the future to have some way to wrap/mark a nsISerialEventTarget to always consider tasks dispatched to it as NS_DISPATCH_EVENT_MAY_BLOCK for call-sites like these which accept an event target, but provide no mechanism to customize the flags passed to Dispatch.
| Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Comment 3•4 years ago
|
||
Backed out changeset 584a442f7d7b (Bug 1734700) for causing failures in test_feature_fileioall.js CLOSED TREE
Log: https://treeherder.mozilla.org/logviewer?job_id=354927551&repo=autoland&lineNumber=2645
Backout: https://hg.mozilla.org/integration/autoland/rev/a06f7e089fba840628106dbfb180bce798ea938c
| Assignee | ||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
| bugherder | ||
Description
•