Bug 196733

Summary: [WPE] Avoid async IO starving timers
Product: WebKit Reporter: Enrique Ocaña <eocanha>
Component: WPE WebKitAssignee: Enrique Ocaña <eocanha>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, bugs-noreply, calvaris, cdumez, cgarcia, cmarcelo, commit-queue, dbates, ews-watchlist, zan
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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]
Patch
Comment 2 Carlos Garcia Campos 2019-04-10 00:54:06 PDT
Comment on attachment 367043 [details]
Patch

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]
Patch

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.