Task submitted to TaskController takes a while to be executed
Categories
(Core :: XPCOM, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: allstars.chh, Assigned: bas.schouten)
References
Details
(Keywords: perf-alert)
Attachments
(1 file)
There's a similar bug 1685727 but I think this is a different problem so filing another bug for this.
After calling TaskController::AddTask, I found the task isn't executed by other threads, and the reason is that most threads are in the waiting state of mThreadPoolCV.
https://searchfox.org/mozilla-central/rev/31ddf859c57e812878a5f817e4097efb06de4d97/xpcom/threads/TaskController.cpp#301
The mThreadPoolCV can be only notified in TaskController::ShutdownThreadPoolInternal
https://searchfox.org/mozilla-central/rev/31ddf859c57e812878a5f817e4097efb06de4d97/xpcom/threads/TaskController.cpp#177
or
TaskController::ProcessPendingMTTask
For a mozilla::Task with mMainThreadOnly is false, does it make sense to do mThreadPoolCV.NotifyAll() when we call AddTask()?
I tried this and it seems working (Task gets executed because other threads have been notified).
Hi Bas, can you help to clarify this? Or if we shouldn't do the mThreadPoolCV.NofityAll() in AddTask(), can you explain the reason? Or, can you suggest what should I do to make the Task gets executed earlier?
Thanks
Reporter | ||
Comment 1•4 years ago
|
||
ping Bas and he says this is definitely a bug.
Assignee | ||
Comment 2•4 years ago
|
||
Assignee | ||
Comment 3•4 years ago
|
||
Good catch. This seems like there's a problem. Posted a patch, could you confirm this addresses your issue as well?
Reporter | ||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
bugherder |
Comment 6•4 years ago
|
||
== Change summary for alert #28528 (as of Mon, 25 Jan 2021 08:27:12 GMT) ==
Improvements:
Ratio | Suite | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|---|
31% | SpeedIndex | linux64-shippable | nocondprof warm | 525.58 -> 362.58 | |
29% | PerceptualSpeedIndex | linux64-shippable | nocondprof warm | 518.92 -> 367.00 | |
25% | SpeedIndex | linux64-shippable-qr | nocondprof warm webrender | 498.21 -> 372.67 | |
25% | ContentfulSpeedIndex | macosx1014-64-shippable-qr | nocondprof warm webrender | 525.17 -> 393.33 | |
24% | PerceptualSpeedIndex | linux64-shippable-qr | nocondprof warm webrender | 493.42 -> 376.08 | |
21% | SpeedIndex | linux64-shippable-qr | nocondprof warm webrender | 485.21 -> 384.25 | |
17% | imdb | ContentfulSpeedIndex | android-hw-p2-8-0-android-aarch64-shippable | nocondprof warm webrender | 1,287.50 -> 1,065.67 |
16% | imdb | SpeedIndex | android-hw-p2-8-0-android-aarch64-shippable | nocondprof warm webrender | 1,157.04 -> 975.08 |
10% | ContentfulSpeedIndex | linux64-shippable | nocondprof warm | 313.83 -> 281.67 | |
10% | youtube | ContentfulSpeedIndex | macosx1014-64-shippable-qr | nocondprof warm webrender | 1,223.58 -> 1,102.33 |
8% | allrecipes | ContentfulSpeedIndex | android-hw-p2-8-0-android-aarch64-shippable | nocondprof warm | 645.50 -> 594.00 |
6% | youtube | ContentfulSpeedIndex | macosx1014-64-shippable-qr | cold nocondprof webrender | 2,036.92 -> 1,922.08 |
6% | microsoft-support | LastVisualChange | android-hw-g5-7-0-arm7-api-16-shippable | nocondprof warm | 2,275.21 -> 2,147.75 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=28528
Updated•4 years ago
|
Description
•