Merge pull request #2361 from wiredtiger/wt-2260-dont-evict-internal
WT-2260 Avoid adding internal pages to the eviction queue.
This commit is contained in:
committed by
Alex Gorrod
parent
a6957512a4
commit
eb838c7f12
@@ -472,6 +472,15 @@ __evict_update_work(WT_SESSION_IMPL *session)
|
||||
if (!F_ISSET(conn, WT_CONN_EVICTION_RUN))
|
||||
return (false);
|
||||
|
||||
/*
|
||||
* Setup the number of refs to consider in each handle, depending
|
||||
* on how many handles are open. We want to consider less candidates
|
||||
* from each file as more files are open. Handle the case where there
|
||||
* are no files open by adding 1.
|
||||
*/
|
||||
cache->evict_max_refs_per_file =
|
||||
WT_MAX(100, WT_MILLION / (conn->open_file_count + 1));
|
||||
|
||||
/*
|
||||
* Page eviction overrides the dirty target and other types of eviction,
|
||||
* that is, we don't care where we are with respect to the dirty target
|
||||
@@ -1216,7 +1225,7 @@ __evict_walk_file(WT_SESSION_IMPL *session, u_int *slotp)
|
||||
evict < end && !enough && (ret == 0 || ret == WT_NOTFOUND);
|
||||
ret = __wt_tree_walk(
|
||||
session, &btree->evict_ref, &pages_walked, walk_flags)) {
|
||||
enough = pages_walked > WT_EVICT_MAX_PER_FILE;
|
||||
enough = pages_walked > cache->evict_max_refs_per_file;
|
||||
if ((ref = btree->evict_ref) == NULL) {
|
||||
if (++restarts == 2 || enough)
|
||||
break;
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
pages by this many increments of the
|
||||
read generation. */
|
||||
#define WT_EVICT_WALK_PER_FILE 10 /* Pages to queue per file */
|
||||
#define WT_EVICT_MAX_PER_FILE 100 /* Max pages to visit per file */
|
||||
#define WT_EVICT_WALK_BASE 300 /* Pages tracked across file visits */
|
||||
#define WT_EVICT_WALK_INCR 100 /* Pages added each walk */
|
||||
|
||||
@@ -107,6 +106,7 @@ struct __wt_cache {
|
||||
uint32_t evict_slots; /* LRU list eviction slots */
|
||||
WT_DATA_HANDLE
|
||||
*evict_file_next; /* LRU next file to search */
|
||||
uint32_t evict_max_refs_per_file;/* LRU pages per file per pass */
|
||||
|
||||
/*
|
||||
* Cache pool information.
|
||||
|
||||
Reference in New Issue
Block a user