]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
When a thread hints that it is in a spin-wait loop (eg, x86 REP NOP insn),
authorJulian Seward <jseward@acm.org>
Wed, 24 May 2017 13:42:33 +0000 (13:42 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 24 May 2017 13:42:33 +0000 (13:42 +0000)
deschedule the thread much sooner (300 evchecks) than previously (1000
evchecks).  Once the thread is spinning, there's absolutely no point in
continuing with it, since only a different thread can get it out of the loop,
so we need to drop the current thread ASAP.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16412

coregrind/m_scheduler/scheduler.c

index 7bc03f9aadf11c44b4e6575687778bf2910c7104..39f10f888238ffaf6b83a7f0f73d011a6f571e6a 100644 (file)
@@ -1453,8 +1453,8 @@ VgSchedReturnCode VG_(scheduler) ( ThreadId tid )
             before swapping to another.  That means that short term
             spins waiting for hardware to poke memory won't cause a
             thread swap. */
-         if (dispatch_ctr > 1000)
-            dispatch_ctr = 1000;
+         if (dispatch_ctr > 300)
+            dispatch_ctr = 300;
         break;
 
       case VG_TRC_INNER_COUNTERZERO: