Title: [198350] trunk/Source
- Revision
- 198350
- Author
- [email protected]
- Date
- 2016-03-17 13:46:57 -0700 (Thu, 17 Mar 2016)
Log Message
Set the WebContent process's main thread QoS to USER-INTERACTIVE
https://bugs.webkit.org/show_bug.cgi?id=155595
<rdar://problem/22534965>
Reviewed by Antti Koivisto.
Source/WebKit2:
Increase the WebContent process main thread's QoS to USER-INTERACTIVE
instead of USER-INITIATED as it is drawing UI. However, use a relative
priority of -1 so that its priority is lower than the one of the
scrolling thread.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
Source/WTF:
Add a relativePriority parameter to setCurrentThreadIsUser*() so that
we can do more fine-grained prioritization of threads that have the
same QoS.
* wtf/Threading.cpp:
(WTF::setCurrentThreadIsUserInteractive):
(WTF::setCurrentThreadIsUserInitiated):
(WTF::createThread): Deleted.
* wtf/Threading.h:
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (198349 => 198350)
--- trunk/Source/WTF/ChangeLog 2016-03-17 20:38:56 UTC (rev 198349)
+++ trunk/Source/WTF/ChangeLog 2016-03-17 20:46:57 UTC (rev 198350)
@@ -1,3 +1,21 @@
+2016-03-17 Chris Dumez <[email protected]>
+
+ Set the WebContent process's main thread QoS to USER-INTERACTIVE
+ https://bugs.webkit.org/show_bug.cgi?id=155595
+ <rdar://problem/22534965>
+
+ Reviewed by Antti Koivisto.
+
+ Add a relativePriority parameter to setCurrentThreadIsUser*() so that
+ we can do more fine-grained prioritization of threads that have the
+ same QoS.
+
+ * wtf/Threading.cpp:
+ (WTF::setCurrentThreadIsUserInteractive):
+ (WTF::setCurrentThreadIsUserInitiated):
+ (WTF::createThread): Deleted.
+ * wtf/Threading.h:
+
2016-03-17 Filip Pizlo <[email protected]>
Silence leaks in ParkingLot
Modified: trunk/Source/WTF/wtf/Threading.cpp (198349 => 198350)
--- trunk/Source/WTF/wtf/Threading.cpp 2016-03-17 20:38:56 UTC (rev 198349)
+++ trunk/Source/WTF/wtf/Threading.cpp 2016-03-17 20:46:57 UTC (rev 198350)
@@ -26,7 +26,9 @@
#include "config.h"
#include "Threading.h"
-#include <string.h>
+#include <algorithm>
+#include <cmath>
+#include <cstring>
namespace WTF {
@@ -82,17 +84,25 @@
});
}
-void setCurrentThreadIsUserInteractive()
+void setCurrentThreadIsUserInteractive(int relativePriority)
{
#if HAVE(QOS_CLASSES)
- pthread_set_qos_class_self_np(QOS_CLASS_USER_INTERACTIVE, 0);
+ ASSERT(relativePriority <= 0);
+ ASSERT(relativePriority >= QOS_MIN_RELATIVE_PRIORITY);
+ pthread_set_qos_class_self_np(QOS_CLASS_USER_INTERACTIVE, relativePriority);
+#else
+ UNUSED_PARAM(relativePriority);
#endif
}
-void setCurrentThreadIsUserInitiated()
+void setCurrentThreadIsUserInitiated(int relativePriority)
{
#if HAVE(QOS_CLASSES)
- pthread_set_qos_class_self_np(QOS_CLASS_USER_INITIATED, 0);
+ ASSERT(relativePriority <= 0);
+ ASSERT(relativePriority >= QOS_MIN_RELATIVE_PRIORITY);
+ pthread_set_qos_class_self_np(QOS_CLASS_USER_INITIATED, relativePriority);
+#else
+ UNUSED_PARAM(relativePriority);
#endif
}
Modified: trunk/Source/WTF/wtf/Threading.h (198349 => 198350)
--- trunk/Source/WTF/wtf/Threading.h 2016-03-17 20:38:56 UTC (rev 198349)
+++ trunk/Source/WTF/wtf/Threading.h 2016-03-17 20:46:57 UTC (rev 198350)
@@ -58,8 +58,9 @@
WTF_EXPORT_PRIVATE ThreadIdentifier createThread(const char* threadName, std::function<void()>);
// Mark the current thread as requiring UI responsiveness.
-WTF_EXPORT_PRIVATE void setCurrentThreadIsUserInteractive();
-WTF_EXPORT_PRIVATE void setCurrentThreadIsUserInitiated();
+// relativePriority is a value in the range [-15, 0] where a lower value indicates a lower priority.
+WTF_EXPORT_PRIVATE void setCurrentThreadIsUserInteractive(int relativePriority = 0);
+WTF_EXPORT_PRIVATE void setCurrentThreadIsUserInitiated(int relativePriority = 0);
WTF_EXPORT_PRIVATE ThreadIdentifier currentThread();
WTF_EXPORT_PRIVATE void changeThreadPriority(ThreadIdentifier, int);
Modified: trunk/Source/WebKit2/ChangeLog (198349 => 198350)
--- trunk/Source/WebKit2/ChangeLog 2016-03-17 20:38:56 UTC (rev 198349)
+++ trunk/Source/WebKit2/ChangeLog 2016-03-17 20:46:57 UTC (rev 198350)
@@ -1,3 +1,19 @@
+2016-03-17 Chris Dumez <[email protected]>
+
+ Set the WebContent process's main thread QoS to USER-INTERACTIVE
+ https://bugs.webkit.org/show_bug.cgi?id=155595
+ <rdar://problem/22534965>
+
+ Reviewed by Antti Koivisto.
+
+ Increase the WebContent process main thread's QoS to USER-INTERACTIVE
+ instead of USER-INITIATED as it is drawing UI. However, use a relative
+ priority of -1 so that its priority is lower than the one of the
+ scrolling thread.
+
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::initializeWebProcess):
+
2016-03-17 Alex Christensen <[email protected]>
Support manually accepting invalid SSL certificates with NetworkSession
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (198349 => 198350)
--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2016-03-17 20:38:56 UTC (rev 198349)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2016-03-17 20:46:57 UTC (rev 198350)
@@ -268,7 +268,8 @@
platformInitializeWebProcess(WTFMove(parameters));
- WTF::setCurrentThreadIsUserInitiated();
+ // Match the QoS of the UIProcess and the scrolling thread but use a slightly lower priority.
+ WTF::setCurrentThreadIsUserInteractive(-1);
m_suppressMemoryPressureHandler = parameters.shouldSuppressMemoryPressureHandler;
if (!m_suppressMemoryPressureHandler)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes