Replace eviction with lru in metadata structs

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2021-06-15 22:36:27 +02:00
parent 88e04a4204
commit 7c0f940876
10 changed files with 58 additions and 83 deletions

View File

@@ -71,7 +71,7 @@ static ocf_cache_line_t ocf_metadata_get_entries(
switch (type) {
case metadata_segment_collision:
case metadata_segment_cleaning:
case metadata_segment_eviction:
case metadata_segment_lru:
case metadata_segment_list_info:
return cache_lines;
@@ -124,8 +124,8 @@ static int64_t ocf_metadata_get_element_size(
ENV_BUG_ON(type >= metadata_segment_variable_size_start && !settings);
switch (type) {
case metadata_segment_eviction:
size = sizeof(union eviction_policy_meta);
case metadata_segment_lru:
size = sizeof(struct ocf_lru_meta);
break;
case metadata_segment_cleaning:
@@ -328,7 +328,7 @@ const char * const ocf_metadata_segment_names[] = {
[metadata_segment_part_config] = "Part config",
[metadata_segment_part_runtime] = "Part runtime",
[metadata_segment_cleaning] = "Cleaning",
[metadata_segment_eviction] = "Eviction",
[metadata_segment_lru] = "LRU list",
[metadata_segment_collision] = "Collision",
[metadata_segment_list_info] = "List info",
[metadata_segment_hash] = "Hash",
@@ -957,7 +957,7 @@ struct ocf_pipeline_arg ocf_metadata_flush_all_args[] = {
OCF_PL_ARG_INT(metadata_segment_part_runtime),
OCF_PL_ARG_INT(metadata_segment_core_runtime),
OCF_PL_ARG_INT(metadata_segment_cleaning),
OCF_PL_ARG_INT(metadata_segment_eviction),
OCF_PL_ARG_INT(metadata_segment_lru),
OCF_PL_ARG_INT(metadata_segment_collision),
OCF_PL_ARG_INT(metadata_segment_list_info),
OCF_PL_ARG_INT(metadata_segment_hash),
@@ -1101,7 +1101,7 @@ out:
struct ocf_pipeline_arg ocf_metadata_load_all_args[] = {
OCF_PL_ARG_INT(metadata_segment_core_runtime),
OCF_PL_ARG_INT(metadata_segment_cleaning),
OCF_PL_ARG_INT(metadata_segment_eviction),
OCF_PL_ARG_INT(metadata_segment_lru),
OCF_PL_ARG_INT(metadata_segment_collision),
OCF_PL_ARG_INT(metadata_segment_list_info),
OCF_PL_ARG_INT(metadata_segment_hash),

View File

@@ -11,15 +11,14 @@
/*
* Eviction policy - Get
*/
union eviction_policy_meta *
ocf_metadata_get_eviction_policy(struct ocf_cache *cache,
struct ocf_lru_meta * ocf_metadata_get_lru(struct ocf_cache *cache,
ocf_cache_line_t line)
{
struct ocf_metadata_ctrl *ctrl
= (struct ocf_metadata_ctrl *) cache->metadata.priv;
return ocf_metadata_raw_wr_access(cache,
&(ctrl->raw_desc[metadata_segment_eviction]), line);
&(ctrl->raw_desc[metadata_segment_lru]), line);
}

View File

@@ -6,8 +6,8 @@
#ifndef __METADATA_EVICTION_H__
#define __METADATA_EVICTION_H__
union eviction_policy_meta *
ocf_metadata_get_eviction_policy(
struct ocf_lru_meta *
ocf_metadata_get_lru(
struct ocf_cache *cache, ocf_cache_line_t line);
#endif /* METADATA_EVICTION_H_ */

View File

@@ -30,7 +30,7 @@ struct ocf_user_part_config {
struct ocf_part_runtime {
env_atomic curr_size;
struct eviction_policy eviction[OCF_NUM_EVICTION_LISTS];
struct ocf_lru_part_meta lru[OCF_NUM_EVICTION_LISTS];
};
typedef bool ( *_lru_hash_locked_pfn)(struct ocf_request *req,

View File

@@ -32,7 +32,7 @@ enum ocf_metadata_segment_id {
/* sections with size dependent on cache device size go here: */
metadata_segment_cleaning = /*!< Cleaning policy */
metadata_segment_variable_size_start,
metadata_segment_eviction, /*!< Eviction policy */
metadata_segment_lru, /*!< Eviction policy */
metadata_segment_collision, /*!< Collision */
metadata_segment_list_info, /*!< Collision */
metadata_segment_hash, /*!< Hash */