From 9bce42f27c88a88f94c5e5345ced205a0ab36e89 Mon Sep 17 00:00:00 2001 From: dormando Date: Fri, 2 Jan 2015 21:25:18 -0800 Subject: Beginning work for LRU rework Primarily splitting cache_lock into a lock-per LRU, and making the it->slab_clsid lookup indirect. cache_lock is now more or less gone. Stats are still wrong. they need to internally summarize over each sub-class. --- items.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'items.h') diff --git a/items.h b/items.h index b6ae612..88d7c21 100644 --- a/items.h +++ b/items.h @@ -2,6 +2,7 @@ uint64_t get_cas_id(void); /*@null@*/ +item *do_item_alloc_old(char *key, const size_t nkey, const int flags, const rel_time_t exptime, const int nbytes, const uint32_t cur_hv); item *do_item_alloc(char *key, const size_t nkey, const int flags, const rel_time_t exptime, const int nbytes, const uint32_t cur_hv); void item_free(item *it); bool item_size_ok(const size_t nkey, const int flags, const int nbytes); @@ -15,16 +16,17 @@ void do_item_update_nolock(item *it); int do_item_replace(item *it, item *new_it, const uint32_t hv); /*@null@*/ -char *do_item_cachedump(const unsigned int slabs_clsid, const unsigned int limit, unsigned int *bytes); -void do_item_stats(ADD_STAT add_stats, void *c); -void do_item_stats_totals(ADD_STAT add_stats, void *c); +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 item_stats_totals(ADD_STAT add_stats, void *c); /*@null@*/ -void do_item_stats_sizes(ADD_STAT add_stats, void *c); +void item_stats_sizes(ADD_STAT add_stats, void *c); item *do_item_get(const char *key, const size_t nkey, const uint32_t hv); item *do_item_touch(const char *key, const size_t nkey, uint32_t exptime, const uint32_t hv); void item_stats_reset(void); extern pthread_mutex_t cache_lock; +extern pthread_mutex_t lru_locks[POWER_LARGEST]; void item_stats_evictions(uint64_t *evicted); enum crawler_result_type { -- cgit v1.2.1