summaryrefslogtreecommitdiff
path: root/slabs.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2015-01-03 23:34:02 -0800
committerdormando <dormando@rydia.net>2015-01-03 23:34:02 -0800
commitfb2698975689c87db8be170630cced57798d474f (patch)
tree25ab24d70d1cfba88e30da8d4f8675ea843f15ff /slabs.h
parent9bce42f27c88a88f94c5e5345ced205a0ab36e89 (diff)
downloadmemcached-fb2698975689c87db8be170630cced57798d474f.tar.gz
first pass at LRU maintainer thread
The basics work, but tests still do not pass. A background thread wakes up once per second, or when signaled. It is signaled if a slab class gets an allocation request and has fewer than N chunks free. The background thread shuffles LRU's: HOT, WARM, COLD. HOT is where new items exist. HOT and WARM flow into COLD. Active items in COLD flow back to WARM. Evictions are pulled from COLD. item_update's no longer do anything (and need to be fixed to tick it->time). Items are reshuffled within or around LRU's as they reach the bottom. Ratios of HOT/WARM memory are hardcoded, as are the low/high watermarks. Thread is not fast enough right now, sets cannot block on it.
Diffstat (limited to 'slabs.h')
-rw-r--r--slabs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/slabs.h b/slabs.h
index c649c06..012089d 100644
--- a/slabs.h
+++ b/slabs.h
@@ -33,6 +33,9 @@ bool get_stats(const char *stat_type, int nkey, ADD_STAT add_stats, void *c);
/** Fill buffer with stats */ /*@null@*/
void slabs_stats(ADD_STAT add_stats, void *c);
+/* Hints as to freespace in slab class */
+unsigned int slabs_available_chunks(unsigned int id, bool *mem_flag, unsigned int *total_chunks);
+
int start_slab_maintenance_thread(void);
void stop_slab_maintenance_thread(void);