diff options
author | dormando <dormando@rydia.net> | 2016-08-10 02:25:36 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2016-08-19 17:34:55 -0700 |
commit | a45d24d16904086dd40836b5083a6e8b83f8ab5f (patch) | |
tree | 450a5441902496056773efa319898614c5956e4f /items.h | |
parent | fa41fe035072c531701d265afb855df811a48012 (diff) | |
download | memcached-a45d24d16904086dd40836b5083a6e8b83f8ab5f.tar.gz |
pull LRU crawler out into its own file.
~600 lines gone from items.c makes it a lot more manageable.
this change is almost purely moving code around and renaming functions. very
little logic has changed.
Diffstat (limited to 'items.h')
-rw-r--r-- | items.h | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -1,3 +1,10 @@ +#define HOT_LRU 0 +#define WARM_LRU 64 +#define COLD_LRU 128 +#define NOEXP_LRU 192 + +#define CLEAR_LRU(id) (id & ~(3<<6)) + /* See items.c */ uint64_t get_cas_id(void); @@ -16,9 +23,15 @@ int do_item_replace(item *it, item *new_it, const uint32_t hv); int item_is_flushed(item *it); +void do_item_linktail_q(item *it); +void do_item_unlinktail_q(item *it); +item *do_item_crawl_q(item *it); + /*@null@*/ char *item_cachedump(const unsigned int slabs_clsid, const unsigned int limit, unsigned int *bytes); void item_stats(ADD_STAT add_stats, void *c); +void do_item_stats_add_crawl(const int i, const uint64_t reclaimed, + const uint64_t unfetched, const uint64_t checked); void item_stats_totals(ADD_STAT add_stats, void *c); /*@null@*/ void item_stats_sizes(ADD_STAT add_stats, void *c); @@ -34,19 +47,8 @@ item *do_item_touch(const char *key, const size_t nkey, uint32_t exptime, const void item_stats_reset(void); extern pthread_mutex_t lru_locks[POWER_LARGEST]; -enum crawler_result_type { - CRAWLER_OK=0, CRAWLER_RUNNING, CRAWLER_BADCLASS, CRAWLER_NOTSTARTED, CRAWLER_ERROR -}; - 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); - -int start_item_crawler_thread(void); -int stop_item_crawler_thread(void); -int init_lru_crawler(void); -enum crawler_result_type lru_crawler_crawl(char *slabs, enum crawler_run_type, void *c, const int sfd); -void lru_crawler_pause(void); -void lru_crawler_resume(void); |