summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/evict/evict_lru.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index c12110b0f2a..909fe813f98 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -910,23 +910,6 @@ __evict_lru_walk(WT_SESSION_IMPL *session)
WT_RET_NOTFOUND_OK(ret);
/*
- * If we found no pages at all during the walk, something is wrong.
- * Be more aggressive next time.
- *
- * Continue on to sort the queue, in case there are pages left from a
- * previous walk.
- */
- if (ret == WT_NOTFOUND) {
- if (F_ISSET(cache,
- WT_CACHE_EVICT_CLEAN_HARD | WT_CACHE_EVICT_DIRTY_HARD))
- cache->evict_aggressive_score = WT_MIN(
- cache->evict_aggressive_score + WT_EVICT_SCORE_BUMP,
- WT_EVICT_SCORE_MAX);
- WT_STAT_CONN_SET(session, cache_eviction_aggressive_set,
- cache->evict_aggressive_score);
- }
-
- /*
* If the queue we are filling is empty, pages are being requested
* faster than they are being queued.
*/
@@ -1296,7 +1279,7 @@ __evict_walk_file(WT_SESSION_IMPL *session, WT_EVICT_QUEUE *queue,
WT_PAGE_MODIFY *mod;
WT_REF *ref;
WT_TXN_GLOBAL *txn_global;
- uint64_t btree_inuse, bytes_per_slot, cache_inuse;
+ uint64_t btree_inuse, bytes_per_slot, cache_inuse, min_pages;
uint64_t pages_seen, pages_queued, refs_walked;
uint32_t remaining_slots, total_slots, walk_flags;
uint32_t target_pages_clean, target_pages_dirty, target_pages;
@@ -1369,6 +1352,16 @@ __evict_walk_file(WT_SESSION_IMPL *session, WT_EVICT_QUEUE *queue,
FLD_SET(walk_flags, WT_READ_PREV);
/*
+ * Examine at least a reasonable number of pages before deciding
+ * whether to give up. When we are only looking for dirty pages,
+ * search the tree for longer.
+ */
+ min_pages = 10 * target_pages;
+ if (F_ISSET(cache, WT_CACHE_EVICT_DIRTY) &&
+ !F_ISSET(cache, WT_CACHE_EVICT_CLEAN))
+ min_pages *= 10;
+
+ /*
* Get some more eviction candidate pages.
*
* !!! Take care terminating this loop.
@@ -1390,9 +1383,10 @@ __evict_walk_file(WT_SESSION_IMPL *session, WT_EVICT_QUEUE *queue,
* no good eviction candidates can be found. Abandon the walk
* if we get into that situation.
*/
- give_up = !__wt_cache_aggressive(session) && pages_seen > 100 &&
+ give_up = !__wt_cache_aggressive(session) &&
+ pages_seen > min_pages &&
(pages_queued == 0 || (pages_seen / pages_queued) >
- (10 * total_slots / target_pages));
+ (min_pages / target_pages));
if (give_up)
break;