diff options
author | Keith Bostic <keith@wiredtiger.com> | 2015-08-18 10:03:01 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2015-08-18 10:03:01 -0400 |
commit | a59d09a5dbfefb6ff6d21aff49d92511ec65ceb5 (patch) | |
tree | 95aa928274cd005bb3edcdf9df1fdcbf3de01417 /src/btree/bt_page.c | |
parent | e447671a18c8e6189d2c5d32ba6894a0690f9f8f (diff) | |
parent | 41b410e08778ab1f328e35d323b60bcb39f18bf2 (diff) | |
download | mongo-a59d09a5dbfefb6ff6d21aff49d92511ec65ceb5.tar.gz |
Merge branch 'develop' into wt-2025-inline-atomic-functions
Diffstat (limited to 'src/btree/bt_page.c')
-rw-r--r-- | src/btree/bt_page.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/btree/bt_page.c b/src/btree/bt_page.c index 414f7c88ff7..922dc2892b8 100644 --- a/src/btree/bt_page.c +++ b/src/btree/bt_page.c @@ -80,10 +80,13 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags return (WT_NOTFOUND); /* - * The page isn't in memory, attempt to read it. - * Make sure there is space in the cache. + * The page isn't in memory, read it. If this thread is + * allowed to do eviction work, check for space in the + * cache. */ - WT_RET(__wt_cache_eviction_check(session, 1, NULL)); + if (!LF_ISSET(WT_READ_NO_EVICT)) + WT_RET(__wt_cache_eviction_check( + session, 1, NULL)); WT_RET(__wt_cache_read(session, ref)); oldgen = LF_ISSET(WT_READ_WONT_NEED) || F_ISSET(session, WT_SESSION_NO_CACHE); @@ -208,18 +211,20 @@ stall: wait_cnt += 1000; } /* - * If stalling, check if the cache needs help. If we do - * work for the cache, substitute that for a sleep. + * If stalling and this thread is allowed to do eviction + * work, check if the cache needs help. If we do work + * for the cache, substitute that for a sleep. */ - WT_RET( - __wt_cache_eviction_check(session, 1, &cache_work)); - if (!cache_work) { - sleep_cnt = WT_MIN(wait_cnt, 10000); - wait_cnt *= 2; - WT_STAT_FAST_CONN_INCRV( - session, page_sleep, sleep_cnt); - __wt_sleep(0, sleep_cnt); + if (!LF_ISSET(WT_READ_NO_EVICT)) { + WT_RET(__wt_cache_eviction_check( + session, 1, &cache_work)); + if (cache_work) + continue; } + sleep_cnt = WT_MIN(wait_cnt, 10000); + wait_cnt *= 2; + WT_STAT_FAST_CONN_INCRV(session, page_sleep, sleep_cnt); + __wt_sleep(0, sleep_cnt); } } } |