Title: [272362] trunk/Source/WebKit
Revision
272362
Author
lmo...@igalia.com
Date
2021-02-04 00:47:34 -0800 (Thu, 04 Feb 2021)

Log Message

REGRESSION(r267763): [GTK][WPE] Broken main thread assertion in MemoryPressureMonitor
https://bugs.webkit.org/show_bug.cgi?id=217363

Reviewed by Carlos Garcia Campos.

r267763 changed a number of NetworkProcessProxy methods to be
accessible only from the main thread, including allNetworkProcesses().
This function was called from the memory pressure monitor thread
directly to notify high memory usage.

This was causing the debug bots to abort prematurely with many crashes
when in reality just a memory pressure warning would be enough.

Covered by existing tests.

* UIProcess/linux/MemoryPressureMonitor.cpp:
(WebKit::MemoryPressureMonitor::start): Dispatch the memory pressure
notification in the main thread.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (272361 => 272362)


--- trunk/Source/WebKit/ChangeLog	2021-02-04 08:42:05 UTC (rev 272361)
+++ trunk/Source/WebKit/ChangeLog	2021-02-04 08:47:34 UTC (rev 272362)
@@ -1,3 +1,24 @@
+2021-02-04  Lauro Moura  <lmo...@igalia.com>
+
+        REGRESSION(r267763): [GTK][WPE] Broken main thread assertion in MemoryPressureMonitor
+        https://bugs.webkit.org/show_bug.cgi?id=217363
+
+        Reviewed by Carlos Garcia Campos.
+
+        r267763 changed a number of NetworkProcessProxy methods to be
+        accessible only from the main thread, including allNetworkProcesses().
+        This function was called from the memory pressure monitor thread
+        directly to notify high memory usage.
+
+        This was causing the debug bots to abort prematurely with many crashes
+        when in reality just a memory pressure warning would be enough.
+
+        Covered by existing tests.
+
+        * UIProcess/linux/MemoryPressureMonitor.cpp:
+        (WebKit::MemoryPressureMonitor::start): Dispatch the memory pressure
+        notification in the main thread.
+
 2021-02-03  Timothy Horton  <timothy_hor...@apple.com>
 
         ASSERTION FAILED: !size.isEmpty() under platformInitializeWebProcess

Modified: trunk/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp (272361 => 272362)


--- trunk/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp	2021-02-04 08:42:05 UTC (rev 272361)
+++ trunk/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp	2021-02-04 08:47:34 UTC (rev 272362)
@@ -379,8 +379,10 @@
 
             if (usedPercentage >= s_memoryPresurePercentageThreshold) {
                 bool isCritical = (usedPercentage >= s_memoryPresurePercentageThresholdCritical);
-                for (auto* processPool : WebProcessPool::allProcessPools())
-                    processPool->sendMemoryPressureEvent(isCritical);
+                RunLoop::main().dispatch([isCritical] {
+                    for (auto* processPool : WebProcessPool::allProcessPools())
+                        processPool->sendMemoryPressureEvent(isCritical);
+                });
             }
             pollInterval = pollIntervalForUsedMemoryPercentage(usedPercentage);
         }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to