Multiple LRU lists

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2020-05-21 12:36:16 +02:00
parent ac83c4ecd6
commit 41a767de97
9 changed files with 276 additions and 111 deletions

View File

@@ -29,15 +29,37 @@ struct ocf_user_part_config {
struct ocf_user_part_runtime {
uint32_t curr_size;
uint32_t head;
struct eviction_policy eviction;
struct eviction_policy eviction[OCF_NUM_EVICTION_LISTS];
struct cleaning_policy cleaning;
};
struct ocf_user_part {
struct ocf_user_part_config *config;
struct ocf_user_part_runtime *runtime;
/* Iterator state, visiting all eviction lists within a partition
in round robin order */
struct ocf_lru_iter {
/* cache object */
ocf_cache_t cache;
/* target partition id */
ocf_part_id_t part_id;
/* target partition */
struct ocf_user_part *part;
/* per-partition cacheline iterator */
ocf_cache_line_t curr_cline[OCF_NUM_EVICTION_LISTS];
/* available (non-empty) eviction list bitmap rotated so that current
@evp is on the most significant bit */
unsigned long long next_avail_evp;
/* number of available eviction lists */
uint32_t num_avail_evps;
/* current eviction list index */
uint32_t evp;
};
struct ocf_lst_entry lst_valid;
struct ocf_user_part {
struct ocf_user_part_config *config;
struct ocf_user_part_runtime *runtime;
struct ocf_lru_iter eviction_clean_iter;
uint32_t next_eviction_list;
struct ocf_lst_entry lst_valid;
};

View File

@@ -412,7 +412,7 @@ struct ocf_metadata_lock
{
env_rwsem global; /*!< global metadata lock (GML) */
env_rwlock status; /*!< Fast lock for status bits */
env_spinlock eviction; /*!< Fast lock for eviction policy */
env_spinlock eviction[OCF_NUM_EVICTION_LISTS]; /*!< Fast lock for eviction policy */
env_rwsem *hash; /*!< Hash bucket locks */
env_rwsem *collision_pages; /*!< Collision table page locks */
env_spinlock partition[OCF_IO_CLASS_MAX]; /* partition lock */