Bug 196733 - [WPE] Avoid async IO starving timers
Summary: [WPE] Avoid async IO starving timers
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Enrique Ocaña
Depends on:
Reported: 2019-04-09 09:35 PDT by Enrique Ocaña
Modified: 2019-04-10 01:56 PDT (History)
10 users (show)

See Also:

Patch (1.75 KB, patch)
2019-04-09 09:40 PDT, Enrique Ocaña
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enrique Ocaña 2019-04-09 09:35:34 PDT
When loading a big media file (eg: a 180MB MP4 file) the NetworkProcess downloads the whole file before handing it out to the WebProcess. Further debugging showed that the m_bufferingTimer in NetworkResourceLoader (responsible of sending the downloaded data to the WebProcess via IPC) is triggered several times but eventually stops calling bufferingTimerFired() after the timer deadline has passed. The main thread SharedTimer is starved.

This starvation happens because the AsyncIONetwork and DiskCacheRead priorities are higher (have lower values in RunLoopSourcePriority.h) than the MainThreadSharedTimer one.
Comment 1 Enrique Ocaña 2019-04-09 09:40:46 PDT
Created attachment 367043 [details]
Comment 2 Carlos Garcia Campos 2019-04-10 00:54:06 PDT
Comment on attachment 367043 [details]

I think it's time to re-consider using the same priorities than the GTK port, note that fdo backend stopped using -70 for their sources. But yes, in the meantime this patch looks good to me. Thanks!
Comment 3 WebKit Commit Bot 2019-04-10 01:56:01 PDT
Comment on attachment 367043 [details]

Clearing flags on attachment: 367043

Committed r244108: <https://trac.webkit.org/changeset/244108>
Comment 4 WebKit Commit Bot 2019-04-10 01:56:02 PDT
All reviewed patches have been landed.  Closing bug.