An "SCTP timer" thread remains in every content process that used a peer connection, and uses CPU
Categories
(Core :: WebRTC: Networking, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox98 | --- | fixed |
People
(Reporter: florian, Assigned: bwc)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(1 file)
I have two content processes that have used peer connections (but afaik these connections no longer exist). Each of them has an "SCTP timer" thread that according to about:processes (with toolkit.aboutProcesses.showThreads
set to true in about:config) uses 0.2% of a CPU core each.
Reporter | ||
Comment 1•3 years ago
|
||
I don't know what this thread does with the CPU, it is named at https://searchfox.org/mozilla-central/rev/67637695876e27ddbfb6ff99202bb1c951de847a/netwerk/sctp/src/netinet/sctp_callout.c#198 but doesn't seem to be registered with the Gecko Profiler.
Comment 2•3 years ago
|
||
I believe sctp is only used for webrtc. Maybe Nils knows if we can do something about it.
Reporter | ||
Comment 3•3 years ago
|
||
This thread seems to remain active forever in any content process that ever used a data channel (I verified using the demo at https://tomashubelbauer.github.io/webrtc-data-channel-demo/src/index.html). I see this in Slack tabs, my bank's website, air mozilla. https://searchfox.org/mozilla-central/rev/67637695876e27ddbfb6ff99202bb1c951de847a/netwerk/sctp/src/netinet/sctp_callout.c#193,201,206,209 causes a CPU wakeup every 10ms, which probably wastes a lot of power.
So questions:
- Is this 10ms repeating timer really needed in the first place? Could the same result be achieved in a more power efficient way?
- Can we ensure this thread is stopped when it's no longer useful?
- Would it be possible to register this thead with the Gecko Profiler?
Assignee | ||
Comment 4•3 years ago
|
||
(In reply to Florian Quèze [:florian] from comment #3)
This thread seems to remain active forever in any content process that ever used a data channel (I verified using the demo at https://tomashubelbauer.github.io/webrtc-data-channel-demo/src/index.html). I see this in Slack tabs, my bank's website, air mozilla. https://searchfox.org/mozilla-central/rev/67637695876e27ddbfb6ff99202bb1c951de847a/netwerk/sctp/src/netinet/sctp_callout.c#193,201,206,209 causes a CPU wakeup every 10ms, which probably wastes a lot of power.
So questions:
- Is this 10ms repeating timer really needed in the first place? Could the same result be achieved in a more power efficient way?
Unsure, but this thread is internal to libusrsctp, so our control here is limited.
- Can we ensure this thread is stopped when it's no longer useful?
Currently, no. See bug 1646716. We're waiting on a TSan fix from upstream, and once we have that, we can then evaluate whether it is safe to try.
- Would it be possible to register this thead with the Gecko Profiler?
So this thread is internal to libusrsctp, but maybe we could wait for the first callback we get from that thread and register at that time?
Assignee | ||
Comment 5•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
|
||
Assignee | ||
Comment 7•3 years ago
|
||
Comment 9•3 years ago
|
||
bugherder |
Description
•