Bug 1471627 - use a more reasonable stack size for DNS resolver threads; r=valentin
authorNathan Froyd <froydnj@mozilla.com>
Wed, 27 Jun 2018 15:29:12 -0400
changeset 479135 a6191ff2c2fc1cc02d884f375952366497107727
parent 479134 841ed9c78bf765e7d9f40614c29853948b6680d0
child 479136 c50141d4c2cdf1e244c2718773580fe62bf53c5a
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1471627
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1471627 - use a more reasonable stack size for DNS resolver threads; r=valentin We're maintaining a thread pool, we should be using thread pool stack sizes.
netwerk/dns/nsHostResolver.cpp
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -13,16 +13,17 @@
 #endif
 
 #include <stdlib.h>
 #include <ctime>
 #include "nsHostResolver.h"
 #include "nsError.h"
 #include "nsISupportsBase.h"
 #include "nsISupportsUtils.h"
+#include "nsIThreadManager.h"
 #include "nsAutoPtr.h"
 #include "nsPrintfCString.h"
 #include "prthread.h"
 #include "prerror.h"
 #include "prtime.h"
 #include "mozilla/Logging.h"
 #include "PLDHashTable.h"
 #include "plstr.h"
@@ -1046,17 +1047,18 @@ nsHostResolver::ConditionallyCreateThrea
     }
     else if ((mThreadCount < HighThreadThreshold) ||
              (IsHighPriority(rec->flags) && mThreadCount < MAX_RESOLVER_THREADS)) {
         static nsThreadPoolNaming naming;
         nsCString name = naming.GetNextThreadName("DNS Resolver");
 
         // dispatch new worker thread
         nsCOMPtr<nsIThread> thread;
-        nsresult rv = NS_NewNamedThread(name, getter_AddRefs(thread), nullptr);
+        nsresult rv = NS_NewNamedThread(name, getter_AddRefs(thread), nullptr,
+                                        nsIThreadManager::kThreadPoolStackSize);
         if (NS_WARN_IF(NS_FAILED(rv)) || !thread) {
             return rv;
         }
 
         nsCOMPtr<nsIRunnable> event =
             mozilla::NewRunnableMethod("nsHostResolver::ThreadFunc",
                                        this,
                                        &nsHostResolver::ThreadFunc);