summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/evict
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2016-11-07 16:47:30 +1100
committerMichael Cahill <michael.cahill@mongodb.com>2016-11-07 16:47:30 +1100
commit0f0db45770f45eab89bd7c2530a259f5ed5b6334 (patch)
treeea969f7a1ef67a08cf2280d5117f62a84ce94840 /src/third_party/wiredtiger/src/evict
parentd23e79eb9e69bd746416d9f674dfaee59457c887 (diff)
downloadmongo-0f0db45770f45eab89bd7c2530a259f5ed5b6334.tar.gz
Import wiredtiger: 74430da40c96247c0a0d92f011ccfb2b175f1f32 from branch mongodb-3.4
ref: ef9a7983ea..74430da40c for: 3.4.0 SERVER-26753 Minor speed regression (13%) and 'choppy' performance in 3.4 vs 3.2 WT-2415 Add option for join cursors to return false positives WT-2945 Occasional hang running reconfigure fuzz test WT-2947 test suite populate functions need refactoring WT-2953 Test format failure - stuck cache with 1/42MB dirty WT-2961 Add a version drop-down to the web version of the docs WT-2964 WTPERF parallel-pop-btree hung in populate phase WT-2968 backup cursor opens every file WT-2971 Add documentation for raw compression to the WT docs WT-2975 Reduce the memory allocated for statistics WT-2991 Coverity issue 1365198 WT-2998 Add error messages to error returns that might be confusing. WT-2999 Memory leak in join WT_CURSOR with custom extractor WT-3001 WT_EXTENSION_API references are named inconsistently. WT-3003 log generation should not auto generate the record and op types WT-3005 Add top-level .gitignore file. WT-3007 Remove duplicated word in comment WT-3008 Run wtperf stress testing against all maintained branches WT-3009 Test format hung/aborted with small cache (sub 10mB)
Diffstat (limited to 'src/third_party/wiredtiger/src/evict')
-rw-r--r--src/third_party/wiredtiger/src/evict/evict_lru.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/src/third_party/wiredtiger/src/evict/evict_lru.c b/src/third_party/wiredtiger/src/evict/evict_lru.c
index 6c99f3a13dc..909fe813f98 100644
--- a/src/third_party/wiredtiger/src/evict/evict_lru.c
+++ b/src/third_party/wiredtiger/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;
@@ -1453,15 +1447,15 @@ __evict_walk_file(WT_SESSION_IMPL *session, WT_EVICT_QUEUE *queue,
if (modified && !F_ISSET(cache, WT_CACHE_EVICT_DIRTY))
continue;
- /* If eviction gets aggressive, anything else is fair game. */
- if (__wt_cache_aggressive(session))
- goto fast;
-
/* Limit internal pages to 50% of the total. */
if (WT_PAGE_IS_INTERNAL(page) &&
internal_pages >= (int)(evict - start) / 2)
continue;
+ /* If eviction gets aggressive, anything else is fair game. */
+ if (__wt_cache_aggressive(session))
+ goto fast;
+
/*
* If the oldest transaction hasn't changed since the last time
* this page was written, it's unlikely we can make progress.