Use cleaning ops wrapper functions
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
@@ -6,19 +6,6 @@
|
||||
#include "utils_cache_line.h"
|
||||
#include "../promotion/promotion.h"
|
||||
|
||||
void ocf_cleaning_set_hot_cache_line(struct ocf_cache *cache,
|
||||
ocf_cache_line_t line)
|
||||
{
|
||||
ocf_cleaning_t cleaning_type = cache->conf_meta->cleaning_policy_type;
|
||||
|
||||
ENV_BUG_ON(cleaning_type >= ocf_cleaning_max);
|
||||
|
||||
if (cleaning_policy_ops[cleaning_type].set_hot_cache_line) {
|
||||
cleaning_policy_ops[cleaning_type].
|
||||
set_hot_cache_line(cache, line);
|
||||
}
|
||||
}
|
||||
|
||||
static void __set_cache_line_invalid(struct ocf_cache *cache, uint8_t start_bit,
|
||||
uint8_t end_bit, ocf_cache_line_t line,
|
||||
ocf_core_id_t core_id, ocf_part_id_t part_id)
|
||||
@@ -178,6 +165,5 @@ void set_cache_line_dirty(struct ocf_cache *cache, uint8_t start_bit,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ocf_cleaning_set_hot_cache_line(cache, line);
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include "../engine/cache_engine.h"
|
||||
#include "../ocf_request.h"
|
||||
#include "../ocf_def_priv.h"
|
||||
#include "../cleaning/cleaning_ops.c"
|
||||
#include "../cleaning/cleaning_ops.h"
|
||||
|
||||
/**
|
||||
* @file utils_cache_line.h
|
||||
@@ -69,9 +69,6 @@ static inline uint64_t ocf_lines_2_bytes(struct ocf_cache *cache,
|
||||
return lines * ocf_line_size(cache);
|
||||
}
|
||||
|
||||
void ocf_cleaning_set_hot_cache_line(struct ocf_cache *cache,
|
||||
ocf_cache_line_t line);
|
||||
|
||||
/**
|
||||
* @brief Set cache line invalid
|
||||
*
|
||||
@@ -162,13 +159,8 @@ void set_cache_line_dirty(struct ocf_cache *cache, uint8_t start_bit,
|
||||
static inline void ocf_purge_cleaning_policy(struct ocf_cache *cache,
|
||||
ocf_cache_line_t line)
|
||||
{
|
||||
ocf_cleaning_t clean_type = cache->conf_meta->cleaning_policy_type;
|
||||
|
||||
ENV_BUG_ON(clean_type >= ocf_cleaning_max);
|
||||
|
||||
/* Remove from cleaning policy */
|
||||
if (cleaning_policy_ops[clean_type].purge_cache_block != NULL)
|
||||
cleaning_policy_ops[clean_type].purge_cache_block(cache, line);
|
||||
ocf_cleaning_purge_cache_block(cache, line);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -99,9 +99,6 @@ void ocf_user_part_move(struct ocf_request *req)
|
||||
ocf_cache_line_t line;
|
||||
ocf_part_id_t id_old, id_new;
|
||||
uint32_t i;
|
||||
ocf_cleaning_t type = cache->conf_meta->cleaning_policy_type;
|
||||
|
||||
ENV_BUG_ON(type >= ocf_cleaning_max);
|
||||
|
||||
entry = &req->map[0];
|
||||
for (i = 0; i < req->core_line_count; i++, entry++) {
|
||||
@@ -141,9 +138,7 @@ void ocf_user_part_move(struct ocf_request *req)
|
||||
* TODO: Consider adding update_cache_line() ops
|
||||
* to cleaning policy to let policies handle this.
|
||||
*/
|
||||
if (cleaning_policy_ops[type].purge_cache_block)
|
||||
cleaning_policy_ops[type].
|
||||
purge_cache_block(cache, line);
|
||||
ocf_cleaning_purge_cache_block(cache, line);
|
||||
}
|
||||
|
||||
ocf_lru_repart(cache, line, &cache->user_parts[id_old].part,
|
||||
@@ -155,9 +150,7 @@ void ocf_user_part_move(struct ocf_request *req)
|
||||
*/
|
||||
if (metadata_test_dirty(cache, line)) {
|
||||
/* Add cline back to cleaning policy */
|
||||
if (cleaning_policy_ops[type].set_hot_cache_line)
|
||||
cleaning_policy_ops[type].
|
||||
set_hot_cache_line(cache, line);
|
||||
ocf_cleaning_set_hot_cache_line(cache, line);
|
||||
|
||||
env_atomic_inc(&req->core->runtime_meta->
|
||||
part_counters[id_new].dirty_clines);
|
||||
|
Reference in New Issue
Block a user