|
From: <sv...@va...> - 2017-05-24 13:42:40
|
Author: sewardj
Date: Wed May 24 14:42:33 2017
New Revision: 16412
Log:
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
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;
break;
case VG_TRC_INNER_COUNTERZERO:
|