summaryrefslogtreecommitdiff
path: root/src/include/cache.i
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2013-11-26 15:49:05 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2013-11-26 15:49:05 +1100
commit87177372c89c2dccf972153f80ac7092852804a8 (patch)
tree3442639a74b4e21c80cdacec17f7cc1c6e311736 /src/include/cache.i
parentf214f4e40a8d660b0a22107a9b43adcc83c1b246 (diff)
downloadmongo-87177372c89c2dccf972153f80ac7092852804a8.tar.gz
Back out the change to spin in eviction before waiting: it doesn't seem to help in automated tests.
Diffstat (limited to 'src/include/cache.i')
-rw-r--r--src/include/cache.i18
1 files changed, 7 insertions, 11 deletions
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;
}
}