summaryrefslogtreecommitdiff
path: root/src/include/cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/cache.h')
-rw-r--r--src/include/cache.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/include/cache.h b/src/include/cache.h
index 4f7981a5df9..f4a35de7201 100644
--- a/src/include/cache.h
+++ b/src/include/cache.h
@@ -76,6 +76,7 @@ struct __wt_cache {
uint64_t bytes_overflow; /* Bytes of overflow pages */
uint64_t bytes_evict; /* Bytes/pages discarded by eviction */
uint64_t pages_evict;
+ uint64_t pages_evicted; /* Pages evicted during a pass */
uint64_t bytes_dirty; /* Bytes/pages currently dirty */
uint64_t pages_dirty;
uint64_t bytes_read; /* Bytes read into memory */
@@ -86,6 +87,9 @@ struct __wt_cache {
uint64_t worker_evicts; /* Pages evicted by worker threads */
uint64_t evict_max_page_size; /* Largest page seen at eviction */
+#ifdef HAVE_DIAGNOSTIC
+ struct timespec stuck_ts; /* Stuck timestamp */
+#endif
/*
* Read information.
@@ -112,6 +116,8 @@ struct __wt_cache {
/*
* LRU eviction list information.
*/
+ WT_SPINLOCK evict_pass_lock; /* Eviction pass lock */
+ WT_SESSION_IMPL *walk_session; /* Eviction pass session */
WT_SPINLOCK evict_queue_lock; /* Eviction current queue lock */
WT_EVICT_QUEUE evict_queues[WT_EVICT_QUEUE_MAX];
WT_EVICT_QUEUE *evict_current_queue;/* LRU current queue in use */
@@ -144,19 +150,28 @@ struct __wt_cache {
#define WT_EVICT_PASS_DIRTY 0x04
#define WT_EVICT_PASS_WOULD_BLOCK 0x08
uint32_t state;
+ /*
+ * Pass interrupt counter.
+ */
+ uint32_t pass_intr; /* Interrupt eviction pass. */
/*
* Flags.
*/
#define WT_CACHE_POOL_MANAGER 0x01 /* The active cache pool manager */
#define WT_CACHE_POOL_RUN 0x02 /* Cache pool thread running */
-#define WT_CACHE_CLEAR_WALKS 0x04 /* Clear eviction walks */
-#define WT_CACHE_STUCK 0x08 /* Eviction server is stuck */
-#define WT_CACHE_WALK_REVERSE 0x10 /* Scan backwards for candidates */
-#define WT_CACHE_WOULD_BLOCK 0x20 /* Pages that would block apps */
+#define WT_CACHE_STUCK 0x04 /* Eviction server is stuck */
+#define WT_CACHE_WALK_REVERSE 0x08 /* Scan backwards for candidates */
+#define WT_CACHE_WOULD_BLOCK 0x10 /* Pages that would block apps */
uint32_t flags;
};
+#define WT_WITH_PASS_LOCK(session, ret, op) do { \
+ WT_ASSERT(session, !F_ISSET(session, WT_SESSION_LOCKED_PASS)); \
+ WT_WITH_LOCK(session, ret, \
+ &cache->evict_pass_lock, WT_SESSION_LOCKED_PASS, op); \
+} while (0)
+
/*
* WT_CACHE_POOL --
* A structure that represents a shared cache.