ocf_reqest: Store core handle instead of core_id
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
@@ -57,7 +57,7 @@ void set_cache_line_invalid(struct ocf_cache *cache, uint8_t start_bit,
|
||||
ENV_BUG_ON(!req);
|
||||
|
||||
part_id = ocf_metadata_get_partition_id(cache, line);
|
||||
core_id = req->core_id;
|
||||
core_id = ocf_core_get_id(req->core);
|
||||
|
||||
__set_cache_line_invalid(cache, start_bit, end_bit, line, core_id,
|
||||
part_id);
|
||||
@@ -81,7 +81,7 @@ void set_cache_line_invalid_no_flush(struct ocf_cache *cache, uint8_t start_bit,
|
||||
void set_cache_line_valid(struct ocf_cache *cache, uint8_t start_bit,
|
||||
uint8_t end_bit, struct ocf_request *req, uint32_t map_idx)
|
||||
{
|
||||
ocf_core_id_t core_id = req->core_id;
|
||||
ocf_core_id_t core_id = ocf_core_get_id(req->core);
|
||||
ocf_cache_line_t line = req->map[map_idx].coll_idx;
|
||||
ocf_part_id_t part_id = ocf_metadata_get_partition_id(cache, line);
|
||||
|
||||
@@ -101,7 +101,7 @@ void set_cache_line_valid(struct ocf_cache *cache, uint8_t start_bit,
|
||||
void set_cache_line_clean(struct ocf_cache *cache, uint8_t start_bit,
|
||||
uint8_t end_bit, struct ocf_request *req, uint32_t map_idx)
|
||||
{
|
||||
ocf_core_id_t core_id = req->core_id;
|
||||
ocf_core_id_t core_id = ocf_core_get_id(req->core);
|
||||
ocf_cache_line_t line = req->map[map_idx].coll_idx;
|
||||
ocf_part_id_t part_id = ocf_metadata_get_partition_id(cache, line);
|
||||
uint8_t evp_type = cache->conf_meta->eviction_policy_type;
|
||||
@@ -141,7 +141,7 @@ void set_cache_line_clean(struct ocf_cache *cache, uint8_t start_bit,
|
||||
void set_cache_line_dirty(struct ocf_cache *cache, uint8_t start_bit,
|
||||
uint8_t end_bit, struct ocf_request *req, uint32_t map_idx)
|
||||
{
|
||||
ocf_core_id_t core_id = req->core_id;
|
||||
ocf_core_id_t core_id = ocf_core_get_id(req->core);
|
||||
ocf_cache_line_t line = req->map[map_idx].coll_idx;
|
||||
ocf_part_id_t part_id = ocf_metadata_get_partition_id(cache, line);
|
||||
uint8_t evp_type = cache->conf_meta->eviction_policy_type;
|
||||
|
@@ -312,6 +312,7 @@ static int _ocf_cleaner_update_metadata(struct ocf_request *req)
|
||||
const struct ocf_map_info *iter = req->map;
|
||||
uint32_t i;
|
||||
ocf_cache_line_t cache_line;
|
||||
ocf_core_id_t core_id;
|
||||
|
||||
OCF_DEBUG_TRACE(req->cache);
|
||||
|
||||
@@ -332,7 +333,8 @@ static int _ocf_cleaner_update_metadata(struct ocf_request *req)
|
||||
continue;
|
||||
|
||||
ocf_metadata_get_core_and_part_id(cache, cache_line,
|
||||
&req->core_id, &req->part_id);
|
||||
&core_id, &req->part_id);
|
||||
req->core = &cache->core[core_id];
|
||||
|
||||
set_cache_line_clean(cache, 0, ocf_line_end_sector(cache), req,
|
||||
i);
|
||||
|
@@ -237,8 +237,7 @@ void ocf_submit_cache_reqs(struct ocf_cache *cache,
|
||||
uint32_t i;
|
||||
int err;
|
||||
|
||||
cache_stats = &cache->core[req->core_id].
|
||||
counters->cache_blocks;
|
||||
cache_stats = &req->core->counters->cache_blocks;
|
||||
|
||||
if (reqs == 1) {
|
||||
io = ocf_new_cache_io(cache);
|
||||
@@ -328,7 +327,6 @@ update_stats:
|
||||
void ocf_submit_volume_req(ocf_volume_t volume, struct ocf_request *req,
|
||||
ocf_req_end_t callback)
|
||||
{
|
||||
struct ocf_cache *cache = req->cache;
|
||||
struct ocf_counters_block *core_stats;
|
||||
uint64_t flags = req->io ? req->io->flags : 0;
|
||||
uint32_t class = req->io ? req->io->io_class : 0;
|
||||
@@ -336,8 +334,7 @@ void ocf_submit_volume_req(ocf_volume_t volume, struct ocf_request *req,
|
||||
struct ocf_io *io;
|
||||
int err;
|
||||
|
||||
core_stats = &cache->core[req->core_id].
|
||||
counters->core_blocks;
|
||||
core_stats = &req->core->counters->core_blocks;
|
||||
if (dir == OCF_WRITE)
|
||||
env_atomic64_add(req->byte_length, &core_stats->write_bytes);
|
||||
else if (dir == OCF_READ)
|
||||
|
@@ -95,6 +95,7 @@ void ocf_part_move(struct ocf_request *req)
|
||||
ocf_part_id_t id_old, id_new;
|
||||
uint32_t i;
|
||||
ocf_cleaning_t type = cache->conf_meta->cleaning_policy_type;
|
||||
ocf_core_id_t core_id = ocf_core_get_id(req->core);
|
||||
|
||||
ENV_BUG_ON(type >= ocf_cleaning_max);
|
||||
|
||||
@@ -157,15 +158,15 @@ void ocf_part_move(struct ocf_request *req)
|
||||
cleaning_policy_ops[type].
|
||||
set_hot_cache_line(cache, line);
|
||||
|
||||
env_atomic_inc(&cache->core_runtime_meta[req->core_id].
|
||||
env_atomic_inc(&cache->core_runtime_meta[core_id].
|
||||
part_counters[id_new].dirty_clines);
|
||||
env_atomic_dec(&cache->core_runtime_meta[req->core_id].
|
||||
env_atomic_dec(&cache->core_runtime_meta[core_id].
|
||||
part_counters[id_old].dirty_clines);
|
||||
}
|
||||
|
||||
env_atomic_inc(&cache->core_runtime_meta[req->core_id].
|
||||
env_atomic_inc(&cache->core_runtime_meta[core_id].
|
||||
part_counters[id_new].cached_clines);
|
||||
env_atomic_dec(&cache->core_runtime_meta[req->core_id].
|
||||
env_atomic_dec(&cache->core_runtime_meta[core_id].
|
||||
part_counters[id_old].cached_clines);
|
||||
|
||||
/* DONE */
|
||||
|
@@ -187,8 +187,7 @@ struct ocf_request *ocf_req_new(ocf_queue_t queue, ocf_core_t core,
|
||||
ocf_queue_get(queue);
|
||||
req->io_queue = queue;
|
||||
|
||||
/* TODO: Store core pointer instead of id */
|
||||
req->core_id = core ? ocf_core_get_id(core) : 0;
|
||||
req->core = core;
|
||||
req->cache = cache;
|
||||
|
||||
req->d2c = (queue != cache->mngt_queue) && !ocf_refcnt_inc(
|
||||
|
Reference in New Issue
Block a user