From 87177372c89c2dccf972153f80ac7092852804a8 Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Tue, 26 Nov 2013 15:49:05 +1100 Subject: Back out the change to spin in eviction before waiting: it doesn't seem to help in automated tests. --- src/include/cache.i | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/include/cache.i') diff --git a/src/include/cache.i b/src/include/cache.i index 0d6193b5cb8..7d2bba21717 100644 --- a/src/include/cache.i +++ b/src/include/cache.i @@ -52,7 +52,7 @@ __wt_cache_full_check(WT_SESSION_IMPL *session) WT_DECL_RET; WT_TXN_GLOBAL *txn_global; WT_TXN_STATE *txn_state; - int busy, count, full, loops; + int busy, count, full; /* * If the current transaction is keeping the oldest ID pinned, it is in @@ -90,7 +90,7 @@ __wt_cache_full_check(WT_SESSION_IMPL *session) F_ISSET(btree, WT_BTREE_BULK | WT_BTREE_NO_EVICTION)) return (0); - for (loops = 0;; loops++) { + for (;;) { switch (ret = __wt_evict_lru_page(session, 1)) { case 0: if (--count == 0) @@ -122,16 +122,12 @@ __wt_cache_full_check(WT_SESSION_IMPL *session) } /* Wait for the queue to re-populate before trying again. */ - if (loops < 20) - __wt_yield(); - else - WT_RET(__wt_cond_wait(session, - S2C(session)->cache->evict_waiter_cond, 100000)); + WT_RET(__wt_cond_wait(session, + S2C(session)->cache->evict_waiter_cond, 100000)); /* Check if things have changed so that we are busy. */ - busy = busy || (txn_state->snap_min != WT_TXN_NONE && - txn_global->current != txn_global->oldest_id); - if (busy) - count = 1; + if (!busy && txn_state->snap_min != WT_TXN_NONE && + txn_global->current != txn_global->oldest_id) + busy = count = 1; } } -- cgit v1.2.1