diff options
author | dormando <dormando@rydia.net> | 2015-01-03 23:34:02 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2015-01-03 23:34:02 -0800 |
commit | fb2698975689c87db8be170630cced57798d474f (patch) | |
tree | 25ab24d70d1cfba88e30da8d4f8675ea843f15ff /items.h | |
parent | 9bce42f27c88a88f94c5e5345ced205a0ab36e89 (diff) | |
download | memcached-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 'items.h')
-rw-r--r-- | items.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -33,6 +33,13 @@ enum crawler_result_type { CRAWLER_OK=0, CRAWLER_RUNNING, CRAWLER_BADCLASS }; +int start_lru_maintainer_thread(void); +int stop_lru_maintainer_thread(void); +int init_lru_maintainer(void); +void lru_maintainer_pause(void); +void lru_maintainer_resume(void); +void lru_maintainer_wake(int slabs_clsid); + int start_item_crawler_thread(void); int stop_item_crawler_thread(void); int init_lru_crawler(void); |