Valgrind: r16412 - /trunk/coregrind/m_scheduler/scheduler.c

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Valgrind: r16412 - /trunk/coregrind/m_scheduler/scheduler.c

Author: sewardj
Date: Wed May 24 14:42:33 2017
New Revision: 16412

When a thread hints that it is in a spin-wait loop (eg, x86 REP NOP insn),
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.


Modified: trunk/coregrind/m_scheduler/scheduler.c
--- trunk/coregrind/m_scheduler/scheduler.c (original)
+++ trunk/coregrind/m_scheduler/scheduler.c Wed May 24 14:42:33 2017
@@ -1453,8 +1453,8 @@
             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;

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Valgrind-developers mailing list
[hidden email]