Remove eviction policy abstraction
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
@@ -202,7 +202,7 @@ static void ocf_engine_set_hot(struct ocf_request *req)
|
||||
|
||||
if (status == LOOKUP_HIT) {
|
||||
/* Update eviction (LRU) */
|
||||
ocf_eviction_set_hot_cache_line(cache, entry->coll_idx);
|
||||
evp_lru_hot_cline(cache, entry->coll_idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -518,7 +518,7 @@ int ocf_engine_prepare_clines(struct ocf_request *req)
|
||||
ocf_hb_req_prot_unlock_wr(req);
|
||||
|
||||
if (ocf_req_is_cleaning_required(req)) {
|
||||
ocf_lru_flush_dirty(req->cache, user_part, req->io_queue,
|
||||
evp_lru_clean(req->cache, user_part, req->io_queue,
|
||||
128);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,24 +4,9 @@
|
||||
*/
|
||||
|
||||
#include "eviction.h"
|
||||
#include "ops.h"
|
||||
#include "../utils/utils_user_part.h"
|
||||
#include "../engine/engine_common.h"
|
||||
|
||||
struct eviction_policy_ops evict_policy_ops[ocf_eviction_max] = {
|
||||
[ocf_eviction_lru] = {
|
||||
.init_cline = evp_lru_init_cline,
|
||||
.rm_cline = evp_lru_rm_cline,
|
||||
.req_clines = evp_lru_req_clines,
|
||||
.hot_cline = evp_lru_hot_cline,
|
||||
.init_evp = evp_lru_init_evp,
|
||||
.dirty_cline = evp_lru_dirty_cline,
|
||||
.clean_cline = evp_lru_clean_cline,
|
||||
.flush_dirty = evp_lru_clean,
|
||||
.name = "lru",
|
||||
},
|
||||
};
|
||||
|
||||
static uint32_t ocf_evict_calculate(ocf_cache_t cache,
|
||||
struct ocf_user_part *user_part, uint32_t to_evict)
|
||||
{
|
||||
@@ -49,9 +34,6 @@ static inline uint32_t ocf_evict_part_do(struct ocf_request *req,
|
||||
uint32_t unmapped = ocf_engine_unmapped_count(req);
|
||||
uint32_t to_evict = 0;
|
||||
|
||||
if (!evp_lru_can_evict(req->cache))
|
||||
return 0;
|
||||
|
||||
to_evict = ocf_evict_calculate(req->cache, user_part, unmapped);
|
||||
|
||||
if (to_evict < unmapped) {
|
||||
@@ -60,8 +42,7 @@ static inline uint32_t ocf_evict_part_do(struct ocf_request *req,
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ocf_request_space(req->cache, req, &user_part->part,
|
||||
to_evict);
|
||||
return evp_lru_req_clines(req, &user_part->part, to_evict);
|
||||
}
|
||||
|
||||
static inline uint32_t ocf_evict_user_partitions(ocf_cache_t cache,
|
||||
@@ -75,9 +56,6 @@ static inline uint32_t ocf_evict_user_partitions(ocf_cache_t cache,
|
||||
|
||||
/* For each partition from the lowest priority to highest one */
|
||||
for_each_user_part(cache, user_part, part_id) {
|
||||
if (!ocf_eviction_can_evict(cache))
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* Check stop and continue conditions
|
||||
*/
|
||||
@@ -111,8 +89,7 @@ static inline uint32_t ocf_evict_user_partitions(ocf_cache_t cache,
|
||||
if (overflown_only)
|
||||
to_evict = OCF_MIN(to_evict, overflow_size);
|
||||
|
||||
evicted += ocf_request_space(cache, req, &user_part->part,
|
||||
to_evict);
|
||||
evicted += evp_lru_req_clines(req, &user_part->part, to_evict);
|
||||
|
||||
if (evicted >= evict_cline_no) {
|
||||
/* Evicted requested number of cache line, stop
|
||||
@@ -135,10 +112,9 @@ static inline uint32_t ocf_remap_do(struct ocf_request *req)
|
||||
uint32_t remapped = 0;
|
||||
|
||||
/* First attempt to map from freelist */
|
||||
if (ocf_lru_num_free(cache) > 0) {
|
||||
remapped = ocf_request_space(cache, req, &cache->free,
|
||||
remap_cline_no);
|
||||
}
|
||||
if (ocf_lru_num_free(cache) > 0)
|
||||
remapped = evp_lru_req_clines(req, &cache->free, remap_cline_no);
|
||||
|
||||
if (remapped >= remap_cline_no)
|
||||
return remapped;
|
||||
|
||||
|
||||
@@ -31,32 +31,6 @@ union eviction_policy_meta {
|
||||
struct lru_eviction_policy_meta lru;
|
||||
} __attribute__((packed));
|
||||
|
||||
/* the caller must hold the metadata lock for all operations
|
||||
*
|
||||
* For range operations the caller can:
|
||||
* set core_id to -1 to purge the whole cache device
|
||||
* set core_id to -2 to purge the whole cache partition
|
||||
*/
|
||||
struct eviction_policy_ops {
|
||||
void (*init_cline)(ocf_cache_t cache, ocf_cache_line_t cline);
|
||||
void (*rm_cline)(ocf_cache_t cache,
|
||||
ocf_cache_line_t cline);
|
||||
bool (*can_evict)(ocf_cache_t cache);
|
||||
uint32_t (*req_clines)(struct ocf_request *req, struct ocf_part *part,
|
||||
uint32_t cline_no);
|
||||
void (*hot_cline)(ocf_cache_t cache, ocf_cache_line_t cline);
|
||||
void (*init_evp)(ocf_cache_t cache, struct ocf_part *part);
|
||||
void (*dirty_cline)(ocf_cache_t cache, struct ocf_part *part,
|
||||
ocf_cache_line_t cline);
|
||||
void (*clean_cline)(ocf_cache_t cache, struct ocf_part *part,
|
||||
ocf_cache_line_t cline);
|
||||
void (*flush_dirty)(ocf_cache_t cache, struct ocf_user_part *user_part,
|
||||
ocf_queue_t io_queue, uint32_t count);
|
||||
const char *name;
|
||||
};
|
||||
|
||||
extern struct eviction_policy_ops evict_policy_ops[ocf_eviction_max];
|
||||
|
||||
/*
|
||||
* Deallocates space according to eviction priorities.
|
||||
*
|
||||
@@ -68,8 +42,6 @@ int ocf_space_managment_remap_do(struct ocf_request *req);
|
||||
|
||||
int space_management_free(ocf_cache_t cache, uint32_t count);
|
||||
|
||||
void ocf_lru_populate(ocf_cache_t cache, ocf_cache_line_t num_free_clines);
|
||||
|
||||
typedef void (*ocf_metadata_actor_t)(struct ocf_cache *cache,
|
||||
ocf_cache_line_t cache_line);
|
||||
|
||||
@@ -77,10 +49,4 @@ int ocf_metadata_actor(struct ocf_cache *cache,
|
||||
ocf_part_id_t part_id, ocf_core_id_t core_id,
|
||||
uint64_t start_byte, uint64_t end_byte,
|
||||
ocf_metadata_actor_t actor);
|
||||
|
||||
void ocf_lru_repart(ocf_cache_t cache, ocf_cache_line_t cline,
|
||||
struct ocf_part *src_upart, struct ocf_part *dst_upart);
|
||||
|
||||
uint32_t ocf_lru_num_free(ocf_cache_t cache);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "eviction.h"
|
||||
#include "lru.h"
|
||||
#include "ops.h"
|
||||
#include "../utils/utils_cleaner.h"
|
||||
#include "../utils/utils_cache_line.h"
|
||||
#include "../concurrency/ocf_concurrency.h"
|
||||
|
||||
@@ -14,7 +14,7 @@ struct ocf_part_runtime;
|
||||
struct ocf_part_cleaning_ctx;
|
||||
struct ocf_request;
|
||||
|
||||
void evp_lru_init_cline(struct ocf_cache *cache, ocf_cache_line_t cline);
|
||||
void evp_lru_init_cline(ocf_cache_t cache, ocf_cache_line_t cline);
|
||||
void evp_lru_rm_cline(struct ocf_cache *cache, ocf_cache_line_t cline);
|
||||
bool evp_lru_can_evict(struct ocf_cache *cache);
|
||||
uint32_t evp_lru_req_clines(struct ocf_request *req,
|
||||
@@ -27,4 +27,9 @@ void evp_lru_clean_cline(struct ocf_cache *cache, struct ocf_part *part,
|
||||
ocf_cache_line_t cline);
|
||||
void evp_lru_clean(ocf_cache_t cache, struct ocf_user_part *user_part,
|
||||
ocf_queue_t io_queue, uint32_t count);
|
||||
void ocf_lru_repart(ocf_cache_t cache, ocf_cache_line_t cline,
|
||||
struct ocf_part *src_upart, struct ocf_part *dst_upart);
|
||||
uint32_t ocf_lru_num_free(ocf_cache_t cache);
|
||||
void ocf_lru_populate(ocf_cache_t cache, ocf_cache_line_t num_free_clines);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Copyright(c) 2012-2021 Intel Corporation
|
||||
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
*/
|
||||
|
||||
#ifndef LAYER_EVICTION_POLICY_OPS_H_
|
||||
#define LAYER_EVICTION_POLICY_OPS_H_
|
||||
|
||||
#include "eviction.h"
|
||||
#include "../metadata/metadata.h"
|
||||
#include "../concurrency/ocf_metadata_concurrency.h"
|
||||
|
||||
/**
|
||||
* @brief Initialize cache line before adding it into eviction
|
||||
*
|
||||
* @note This operation is called under WR metadata lock
|
||||
*/
|
||||
static inline void ocf_eviction_init_cache_line(struct ocf_cache *cache,
|
||||
ocf_cache_line_t line)
|
||||
{
|
||||
uint8_t type;
|
||||
|
||||
type = cache->conf_meta->eviction_policy_type;
|
||||
|
||||
ENV_BUG_ON(type >= ocf_eviction_max);
|
||||
|
||||
if (likely(evict_policy_ops[type].init_cline))
|
||||
evict_policy_ops[type].init_cline(cache, line);
|
||||
}
|
||||
|
||||
static inline void ocf_eviction_purge_cache_line(
|
||||
struct ocf_cache *cache, ocf_cache_line_t line)
|
||||
{
|
||||
uint8_t type = cache->conf_meta->eviction_policy_type;
|
||||
|
||||
ENV_BUG_ON(type >= ocf_eviction_max);
|
||||
|
||||
if (likely(evict_policy_ops[type].rm_cline)) {
|
||||
evict_policy_ops[type].rm_cline(cache, line);
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool ocf_eviction_can_evict(struct ocf_cache *cache)
|
||||
{
|
||||
uint8_t type = cache->conf_meta->eviction_policy_type;
|
||||
|
||||
if (likely(evict_policy_ops[type].can_evict))
|
||||
return evict_policy_ops[type].can_evict(cache);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline uint32_t ocf_request_space(ocf_cache_t cache,
|
||||
struct ocf_request *req, struct ocf_part *part,
|
||||
uint32_t clines)
|
||||
{
|
||||
uint8_t type;
|
||||
uint32_t result = 0;
|
||||
|
||||
type = cache->conf_meta->eviction_policy_type;
|
||||
|
||||
ENV_BUG_ON(type >= ocf_eviction_max);
|
||||
|
||||
if (likely(evict_policy_ops[type].req_clines))
|
||||
result = evict_policy_ops[type].req_clines(req, part, clines);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline void ocf_eviction_set_hot_cache_line(
|
||||
struct ocf_cache *cache, ocf_cache_line_t line)
|
||||
{
|
||||
uint8_t type = cache->conf_meta->eviction_policy_type;
|
||||
|
||||
ENV_BUG_ON(type >= ocf_eviction_max);
|
||||
|
||||
if (likely(evict_policy_ops[type].hot_cline)) {
|
||||
evict_policy_ops[type].hot_cline(cache, line);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void ocf_eviction_initialize(struct ocf_cache *cache,
|
||||
struct ocf_part *part)
|
||||
{
|
||||
uint8_t type = cache->conf_meta->eviction_policy_type;
|
||||
|
||||
ENV_BUG_ON(type >= ocf_eviction_max);
|
||||
|
||||
if (likely(evict_policy_ops[type].init_evp)) {
|
||||
evict_policy_ops[type].init_evp(cache, part);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void ocf_lru_flush_dirty(ocf_cache_t cache,
|
||||
struct ocf_user_part *user_part, ocf_queue_t io_queue,
|
||||
uint32_t count)
|
||||
{
|
||||
uint8_t type = cache->conf_meta->eviction_policy_type;
|
||||
|
||||
ENV_BUG_ON(type >= ocf_eviction_max);
|
||||
|
||||
if (likely(evict_policy_ops[type].flush_dirty)) {
|
||||
evict_policy_ops[type].flush_dirty(cache, user_part, io_queue,
|
||||
count);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* LAYER_EVICTION_POLICY_OPS_H_ */
|
||||
@@ -1167,9 +1167,9 @@ static void _recovery_rebuild_cline_metadata(ocf_cache_t cache,
|
||||
ocf_metadata_add_to_collision(cache, core_id, core_line, hash_index,
|
||||
cache_line);
|
||||
|
||||
ocf_eviction_init_cache_line(cache, cache_line);
|
||||
evp_lru_init_cline(cache, cache_line);
|
||||
|
||||
ocf_eviction_set_hot_cache_line(cache, cache_line);
|
||||
evp_lru_hot_cline(cache, cache_line);
|
||||
|
||||
env_atomic_inc(&core->runtime_meta->cached_clines);
|
||||
env_atomic_inc(&core->runtime_meta->
|
||||
|
||||
@@ -49,8 +49,6 @@ struct ocf_superblock_config {
|
||||
ocf_promotion_t promotion_policy_type;
|
||||
struct promotion_policy_config promotion[PROMOTION_POLICY_TYPE_MAX];
|
||||
|
||||
ocf_eviction_t eviction_policy_type;
|
||||
|
||||
/*
|
||||
* Checksum for each metadata region.
|
||||
* This field has to be the last one!
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "../utils/utils_refcnt.h"
|
||||
#include "../utils/utils_async_lock.h"
|
||||
#include "../concurrency/ocf_concurrency.h"
|
||||
#include "../eviction/ops.h"
|
||||
#include "../eviction/lru.h"
|
||||
#include "../ocf_ctx_priv.h"
|
||||
#include "../cleaning/cleaning.h"
|
||||
#include "../promotion/ops.h"
|
||||
@@ -185,9 +185,9 @@ static void __init_parts_attached(ocf_cache_t cache)
|
||||
ocf_part_id_t part_id;
|
||||
|
||||
for (part_id = 0; part_id < OCF_USER_IO_CLASS_MAX; part_id++)
|
||||
ocf_eviction_initialize(cache, &cache->user_parts[part_id].part);
|
||||
evp_lru_init_evp(cache, &cache->user_parts[part_id].part);
|
||||
|
||||
ocf_eviction_initialize(cache, &cache->free);
|
||||
evp_lru_init_evp(cache, &cache->free);
|
||||
}
|
||||
|
||||
static void __init_free(ocf_cache_t cache)
|
||||
@@ -227,14 +227,6 @@ static void __deinit_cleaning_policy(ocf_cache_t cache)
|
||||
cleaning_policy_ops[cleaning_policy].deinitialize(cache);
|
||||
}
|
||||
|
||||
static void __init_eviction_policy(ocf_cache_t cache,
|
||||
ocf_eviction_t eviction)
|
||||
{
|
||||
ENV_BUG_ON(eviction < 0 || eviction >= ocf_eviction_max);
|
||||
|
||||
cache->conf_meta->eviction_policy_type = eviction;
|
||||
}
|
||||
|
||||
static void __setup_promotion_policy(ocf_cache_t cache)
|
||||
{
|
||||
int i;
|
||||
@@ -286,8 +278,7 @@ static void __reset_stats(ocf_cache_t cache)
|
||||
}
|
||||
}
|
||||
|
||||
static ocf_error_t init_attached_data_structures(ocf_cache_t cache,
|
||||
ocf_eviction_t eviction_policy)
|
||||
static ocf_error_t init_attached_data_structures(ocf_cache_t cache)
|
||||
{
|
||||
ocf_error_t result;
|
||||
|
||||
@@ -305,7 +296,6 @@ static ocf_error_t init_attached_data_structures(ocf_cache_t cache,
|
||||
return result;
|
||||
}
|
||||
|
||||
__init_eviction_policy(cache, eviction_policy);
|
||||
__setup_promotion_policy(cache);
|
||||
|
||||
return 0;
|
||||
@@ -680,7 +670,6 @@ static int _ocf_mngt_init_prepare_cache(struct ocf_cache_mngt_init_params *param
|
||||
cache->pt_unaligned_io = cfg->pt_unaligned_io;
|
||||
cache->use_submit_io_fast = cfg->use_submit_io_fast;
|
||||
|
||||
cache->eviction_policy_init = cfg->eviction_policy;
|
||||
cache->metadata.is_volatile = cfg->metadata_volatile;
|
||||
|
||||
out:
|
||||
@@ -1010,7 +999,7 @@ static void _ocf_mngt_attach_init_instance(ocf_pipeline_t pipeline,
|
||||
ocf_cache_t cache = context->cache;
|
||||
ocf_error_t result;
|
||||
|
||||
result = init_attached_data_structures(cache, cache->eviction_policy_init);
|
||||
result = init_attached_data_structures(cache);
|
||||
if (result)
|
||||
OCF_PL_FINISH_RET(pipeline, result);
|
||||
|
||||
@@ -1872,11 +1861,6 @@ static int _ocf_mngt_cache_validate_cfg(struct ocf_mngt_cache_config *cfg)
|
||||
if (!ocf_cache_mode_is_valid(cfg->cache_mode))
|
||||
return -OCF_ERR_INVALID_CACHE_MODE;
|
||||
|
||||
if (cfg->eviction_policy >= ocf_eviction_max ||
|
||||
cfg->eviction_policy < 0) {
|
||||
return -OCF_ERR_INVAL;
|
||||
}
|
||||
|
||||
if (cfg->promotion_policy >= ocf_promotion_max ||
|
||||
cfg->promotion_policy < 0 ) {
|
||||
return -OCF_ERR_INVAL;
|
||||
@@ -2077,15 +2061,12 @@ static int _ocf_mngt_cache_load_core_log(ocf_core_t core, void *cntx)
|
||||
static void _ocf_mngt_cache_load_log(ocf_cache_t cache)
|
||||
{
|
||||
ocf_cache_mode_t cache_mode = ocf_cache_get_mode(cache);
|
||||
ocf_eviction_t eviction_type = cache->conf_meta->eviction_policy_type;
|
||||
ocf_cleaning_t cleaning_type = cache->conf_meta->cleaning_policy_type;
|
||||
ocf_promotion_t promotion_type = cache->conf_meta->promotion_policy_type;
|
||||
|
||||
ocf_cache_log(cache, log_info, "Successfully loaded\n");
|
||||
ocf_cache_log(cache, log_info, "Cache mode : %s\n",
|
||||
_ocf_cache_mode_get_name(cache_mode));
|
||||
ocf_cache_log(cache, log_info, "Eviction policy : %s\n",
|
||||
evict_policy_ops[eviction_type].name);
|
||||
ocf_cache_log(cache, log_info, "Cleaning policy : %s\n",
|
||||
cleaning_policy_ops[cleaning_type].name);
|
||||
ocf_cache_log(cache, log_info, "Promotion policy : %s\n",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "../metadata/metadata.h"
|
||||
#include "../engine/cache_engine.h"
|
||||
#include "../ocf_request.h"
|
||||
#include "../eviction/ops.h"
|
||||
#include "../eviction/lru.h"
|
||||
#include "../ocf_logger_priv.h"
|
||||
#include "../ocf_queue_priv.h"
|
||||
#include "../engine/engine_common.h"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "../metadata/metadata.h"
|
||||
#include "../engine/cache_engine.h"
|
||||
#include "../utils/utils_user_part.h"
|
||||
#include "../eviction/ops.h"
|
||||
#include "../eviction/lru.h"
|
||||
#include "ocf_env.h"
|
||||
|
||||
static uint64_t _ocf_mngt_count_user_parts_min_size(struct ocf_cache *cache)
|
||||
|
||||
@@ -170,7 +170,6 @@ int ocf_cache_get_info(ocf_cache_t cache, struct ocf_cache_info *info)
|
||||
info->fallback_pt.error_counter =
|
||||
env_atomic_read(&cache->fallback_pt_error_counter);
|
||||
|
||||
info->eviction_policy = cache->conf_meta->eviction_policy_type;
|
||||
info->cleaning_policy = cache->conf_meta->cleaning_policy_type;
|
||||
info->promotion_policy = cache->conf_meta->promotion_policy_type;
|
||||
info->metadata_footprint = ocf_cache_is_device_attached(cache) ?
|
||||
|
||||
@@ -81,8 +81,6 @@ struct ocf_cache {
|
||||
|
||||
struct ocf_part free;
|
||||
|
||||
ocf_eviction_t eviction_policy_init;
|
||||
|
||||
uint32_t fallback_pt_error_threshold;
|
||||
ocf_queue_t mngt_queue;
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ int ocf_cache_io_class_get_info(ocf_cache_t cache, uint32_t io_class,
|
||||
info->min_size = cache->user_parts[part_id].config->min_size;
|
||||
info->max_size = cache->user_parts[part_id].config->max_size;
|
||||
|
||||
info->eviction_policy_type = cache->conf_meta->eviction_policy_type;
|
||||
info->cleaning_policy_type = cache->conf_meta->cleaning_policy_type;
|
||||
|
||||
info->cache_mode = cache->user_parts[part_id].config->cache_mode;
|
||||
|
||||
@@ -103,9 +103,11 @@ void set_cache_line_clean(struct ocf_cache *cache, uint8_t start_bit,
|
||||
ocf_cache_line_t line = req->map[map_idx].coll_idx;
|
||||
ocf_part_id_t part_id = ocf_metadata_get_partition_id(cache, line);
|
||||
struct ocf_part *part = &cache->user_parts[part_id].part;
|
||||
uint8_t evp_type = cache->conf_meta->eviction_policy_type;
|
||||
bool line_is_clean;
|
||||
|
||||
ENV_BUG_ON(part_id > OCF_USER_IO_CLASS_MAX);
|
||||
part = &cache->user_parts[part_id].part;
|
||||
|
||||
if (metadata_clear_dirty_sec_changed(cache, line, start_bit, end_bit,
|
||||
&line_is_clean)) {
|
||||
ocf_metadata_flush_mark(cache, req, map_idx, CLEAN, start_bit,
|
||||
@@ -130,12 +132,7 @@ void set_cache_line_clean(struct ocf_cache *cache, uint8_t start_bit,
|
||||
*/
|
||||
env_atomic_dec(&req->core->runtime_meta->
|
||||
part_counters[part_id].dirty_clines);
|
||||
|
||||
if (likely(evict_policy_ops[evp_type].clean_cline)) {
|
||||
evict_policy_ops[evp_type].clean_cline(cache,
|
||||
part, line);
|
||||
}
|
||||
|
||||
evp_lru_clean_cline(cache, part, line);
|
||||
ocf_purge_cleaning_policy(cache, line);
|
||||
}
|
||||
}
|
||||
@@ -147,10 +144,12 @@ void set_cache_line_dirty(struct ocf_cache *cache, uint8_t start_bit,
|
||||
{
|
||||
ocf_cache_line_t line = req->map[map_idx].coll_idx;
|
||||
ocf_part_id_t part_id = ocf_metadata_get_partition_id(cache, line);
|
||||
struct ocf_part *part = &cache->user_parts[part_id].part;
|
||||
uint8_t evp_type = cache->conf_meta->eviction_policy_type;
|
||||
struct ocf_part *part;
|
||||
bool line_was_dirty;
|
||||
|
||||
ENV_BUG_ON(part_id > OCF_USER_IO_CLASS_MAX);
|
||||
part = &cache->user_parts[part_id].part;
|
||||
|
||||
if (metadata_set_dirty_sec_changed(cache, line, start_bit, end_bit,
|
||||
&line_was_dirty)) {
|
||||
ocf_metadata_flush_mark(cache, req, map_idx, DIRTY, start_bit,
|
||||
@@ -175,11 +174,7 @@ void set_cache_line_dirty(struct ocf_cache *cache, uint8_t start_bit,
|
||||
*/
|
||||
env_atomic_inc(&req->core->runtime_meta->
|
||||
part_counters[part_id].dirty_clines);
|
||||
|
||||
if (likely(evict_policy_ops[evp_type].dirty_cline)) {
|
||||
evict_policy_ops[evp_type].dirty_cline(cache,
|
||||
part, line);
|
||||
}
|
||||
evp_lru_dirty_cline(cache, part, line);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "../metadata/metadata.h"
|
||||
#include "../concurrency/ocf_cache_line_concurrency.h"
|
||||
#include "../eviction/eviction.h"
|
||||
#include "../eviction/ops.h"
|
||||
#include "../engine/cache_engine.h"
|
||||
#include "../ocf_request.h"
|
||||
#include "../ocf_def_priv.h"
|
||||
@@ -180,7 +179,7 @@ static inline void ocf_purge_cleaning_policy(struct ocf_cache *cache,
|
||||
static inline void ocf_purge_eviction_policy(struct ocf_cache *cache,
|
||||
ocf_cache_line_t line)
|
||||
{
|
||||
ocf_eviction_purge_cache_line(cache, line);
|
||||
evp_lru_rm_cline(cache, line);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "../ocf_request.h"
|
||||
#include "../metadata/metadata.h"
|
||||
#include "../engine/cache_engine.h"
|
||||
#include "../eviction/ops.h"
|
||||
#include "../eviction/lru.h"
|
||||
#include "utils_user_part.h"
|
||||
|
||||
static struct ocf_lst_entry *ocf_user_part_lst_getter_valid(
|
||||
|
||||
Reference in New Issue
Block a user