summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsueloverso <sue@mongodb.com>2017-01-09 19:25:52 -0500
committerAlex Gorrod <alexander.gorrod@mongodb.com>2017-01-10 11:25:52 +1100
commitaa1961b0056db9a3b38243d328b07f2d48d90f3d (patch)
treedf6babcb83eec20faf720a6f6cdf792e8eb14ad0
parent247b3a5f2c2b2d8ab53d151fa18a23143501c2b0 (diff)
downloadmongo-aa1961b0056db9a3b38243d328b07f2d48d90f3d.tar.gz
WT-3105 Create all eviction sessions initially to avoid deadlock. (#3237)
-rw-r--r--src/evict/evict_lru.c32
-rw-r--r--src/include/connection.h2
2 files changed, 6 insertions, 28 deletions
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index ba8851812cb..948c1e1139e 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -437,18 +437,11 @@ __wt_evict_create(WT_SESSION_IMPL *session)
/*
* Create the eviction thread group.
- * We don't set the group size to the maximum allowed sessions,
- * because this may have adverse memory effects. Instead,
- * we set the group's maximum to a small value. The code
- * that tunes the number of workers will increase the
- * maximum if necessary.
+ * Set the group size to the maximum allowed sessions.
*/
WT_RET(__wt_thread_group_create(session, &conn->evict_threads,
- "eviction-server", conn->evict_threads_min,
- WT_MAX(conn->evict_threads_min,
- WT_MIN(conn->evict_threads_max, EVICT_GROUP_INCR)),
- WT_THREAD_CAN_WAIT | WT_THREAD_PANIC_FAIL,
- __wt_evict_thread_run));
+ "eviction-server", conn->evict_threads_min, conn->evict_threads_max,
+ WT_THREAD_CAN_WAIT | WT_THREAD_PANIC_FAIL, __wt_evict_thread_run));
/*
* Allow queues to be populated now that the eviction threads
@@ -921,7 +914,7 @@ __evict_tune_workers(WT_SESSION_IMPL *session)
WT_CONNECTION_IMPL *conn;
uint64_t cur_threads, delta_msec, delta_pages, i, target_threads;
uint64_t pgs_evicted_cur, pgs_evicted_persec_cur;
- uint32_t new_max, thread_surplus;
+ uint32_t thread_surplus;
conn = S2C(session);
cache = conn->cache;
@@ -1033,23 +1026,8 @@ __evict_tune_workers(WT_SESSION_IMPL *session)
target_threads = WT_MIN(cur_threads + EVICT_TUNE_BATCH,
conn->evict_threads_max);
/*
- * Resize the group to allow for an additional batch of threads.
- * We resize the group in increments of a few sessions.
- * Allocating the group to accommodate the maximum number of
- * workers has adverse effects on performance due to memory
- * effects, so we gradually ramp up the allocation.
+ * Start the new threads.
*/
- if (conn->evict_threads.max < target_threads) {
- new_max = WT_MIN(conn->evict_threads.max +
- EVICT_GROUP_INCR, conn->evict_threads_max);
-
- WT_RET(__wt_thread_group_resize(
- session, &conn->evict_threads,
- conn->evict_threads_min, new_max,
- WT_THREAD_CAN_WAIT | WT_THREAD_PANIC_FAIL));
- }
-
- /* Now actually start the new threads. */
for (i = 0; i < (target_threads - cur_threads); ++i) {
WT_RET(__wt_thread_group_start_one(session,
&conn->evict_threads, false));
diff --git a/src/include/connection.h b/src/include/connection.h
index 665275440cf..7d2b78e9f66 100644
--- a/src/include/connection.h
+++ b/src/include/connection.h
@@ -107,7 +107,7 @@ struct __wt_named_extractor {
* Allocate some additional slots for internal sessions so the user cannot
* configure too few sessions for us to run.
*/
-#define WT_EXTRA_INTERNAL_SESSIONS 10
+#define WT_EXTRA_INTERNAL_SESSIONS 20
/*
* WT_CONN_CHECK_PANIC --