Bug 1457281 - Remove dom.ipc.scheduler pref. r=froydnj, a=RyanVM
authorAndrew McCreight <continuation@gmail.com>
Thu, 26 Apr 2018 14:21:25 -0700
changeset 473255 458ea52fc8610767a225addb9fbe2fa4447b356f
parent 473254 ee62b33ebe5290d5b27ab75e53aedae57dd2a8b3
child 473256 19a17750a0999c56d9f40845aa78865686ea5b84
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj, RyanVM
bugs1457281
milestone61.0
Bug 1457281 - Remove dom.ipc.scheduler pref. r=froydnj, a=RyanVM The JS engine has changed the APIs that cooperative scheduling relies on into immediate crashes. Some users seem to set the prefs, and then we get a lot of crashes on Nightly. This removes the top-level pref to save them some grief. I continue to pass the pref as false to the child process to avoid weirdness if we somehow we get this far when the parent and child have different versions. MozReview-Commit-ID: 3o3yV2efx2r
modules/libpref/init/all.js
xpcom/threads/Scheduler.cpp
xpcom/threads/Scheduler.h
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -3209,17 +3209,16 @@ pref("dom.ipc.processCount.extension", 1
 // Whether a native event loop should be used in the content process.
 #if defined(XP_WIN)
 pref("dom.ipc.useNativeEventProcessing.content", false);
 #else
 pref("dom.ipc.useNativeEventProcessing.content", true);
 #endif
 
 // Quantum DOM scheduling:
-pref("dom.ipc.scheduler", false);
 pref("dom.ipc.scheduler.useMultipleQueues", true);
 pref("dom.ipc.scheduler.preemption", false);
 pref("dom.ipc.scheduler.threadCount", 2);
 pref("dom.ipc.scheduler.chaoticScheduling", false);
 
 // Disable support for SVG
 pref("svg.disabled", false);
 
--- a/xpcom/threads/Scheduler.cpp
+++ b/xpcom/threads/Scheduler.cpp
@@ -122,17 +122,16 @@ public:
 
   void BlockThreadedExecution(nsIBlockThreadedExecutionCallback* aCallback);
   void UnblockThreadedExecution();
 
   CooperativeThreadPool::Resource* GetQueueResource() { return &mQueueResource; }
   bool UseCooperativeScheduling() const { return mQueue->UseCooperativeScheduling(); }
 
   // Preferences.
-  static bool sPrefScheduler;
   static bool sPrefChaoticScheduling;
   static bool sPrefPreemption;
   static size_t sPrefThreadCount;
   static bool sPrefUseMultipleQueues;
 
 private:
   void Interrupt(JSContext* aCx);
   void YieldFromJS(JSContext* aCx);
@@ -213,17 +212,16 @@ private:
   // Number of times that BlockThreadedExecution has been called without
   // corresponding calls to UnblockThreadedExecution. If this is non-zero,
   // scheduling is disabled.
   size_t mNumSchedulerBlocks = 0;
 
   JSContext* mContexts[CooperativeThreadPool::kMaxThreads];
 };
 
-bool SchedulerImpl::sPrefScheduler = false;
 bool SchedulerImpl::sPrefChaoticScheduling = false;
 bool SchedulerImpl::sPrefPreemption = false;
 bool SchedulerImpl::sPrefUseMultipleQueues = false;
 size_t SchedulerImpl::sPrefThreadCount = 2;
 
 size_t SchedulerImpl::sNumThreadsRunning;
 bool SchedulerImpl::sUnlabeledEventRunning;
 
@@ -773,18 +771,17 @@ Scheduler::Shutdown()
   }
 }
 
 /* static */ nsCString
 Scheduler::GetPrefs()
 {
   MOZ_ASSERT(XRE_IsParentProcess());
   nsPrintfCString result("%d%d%d%d,%d",
-                         Preferences::GetBool("dom.ipc.scheduler",
-                                              SchedulerImpl::sPrefScheduler),
+                         false, // XXX The scheduler is always disabled.
                          Preferences::GetBool("dom.ipc.scheduler.chaoticScheduling",
                                               SchedulerImpl::sPrefChaoticScheduling),
                          Preferences::GetBool("dom.ipc.scheduler.preemption",
                                               SchedulerImpl::sPrefPreemption),
                          Preferences::GetBool("dom.ipc.scheduler.useMultipleQueues",
                                               SchedulerImpl::sPrefUseMultipleQueues),
                          Preferences::GetInt("dom.ipc.scheduler.threadCount",
                                              SchedulerImpl::sPrefThreadCount));
@@ -802,28 +799,28 @@ Scheduler::SetPrefs(const char* aPrefs)
     return;
   }
 
   // If the pref string appears truncated, use the default values.
   if (strlen(aPrefs) < 6) {
     return;
   }
 
-  SchedulerImpl::sPrefScheduler = aPrefs[0] == '1';
   SchedulerImpl::sPrefChaoticScheduling = aPrefs[1] == '1';
   SchedulerImpl::sPrefPreemption = aPrefs[2] == '1';
   SchedulerImpl::sPrefUseMultipleQueues = aPrefs[3] == '1';
   MOZ_ASSERT(aPrefs[4] == ',');
   SchedulerImpl::sPrefThreadCount = atoi(aPrefs + 5);
 }
 
 /* static */ bool
 Scheduler::IsSchedulerEnabled()
 {
-  return SchedulerImpl::sPrefScheduler;
+  // XXX We never enable the scheduler because it will crash immediately.
+  return false;
 }
 
 /* static */ bool
 Scheduler::UseMultipleQueues()
 {
   return SchedulerImpl::sPrefUseMultipleQueues;
 }
 
--- a/xpcom/threads/Scheduler.h
+++ b/xpcom/threads/Scheduler.h
@@ -30,17 +30,17 @@ class SynchronizedEventQueue;
 
 // This is the central class for scheduling work on the "main" thread. It starts
 // a pool of cooperatively scheduled threads (using CooperativeThreadPool) and
 // controls them using a single, main-thread event queue
 // (SchedulerEventQueue). Even if cooperative scheduling is not enabled,
 // Scheduler can schedule work on the main thread. Its behavior is controlled by
 // a number of preferences:
 //
-// "dom.ipc.scheduler": If this pref is false, Scheduler is not used at all.
+// XXX The cooperative scheduler is disabled because it will crash immediately.
 //
 // "dom.ipc.scheduler.useMultipleQueues": When this pref is true, a
 // LabeledEventQueue is used for the main thread event queue. This divides the
 // event queue into multiple queues, one per SchedulerGroup. If the pref is
 // false, a normal EventQueue is used. Either way, event prioritization via
 // PrioritizedEventQueue still happens.
 //
 // "dom.ipc.scheduler.preemption": If this pref is true, then cooperative