ocf_reqest: Store core handle instead of core_id

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga
2019-05-20 17:01:03 +02:00
parent eccd4a0163
commit 0490dd8bd4
26 changed files with 78 additions and 108 deletions

View File

@@ -42,7 +42,7 @@ static uint32_t ocf_evict_calculate(struct ocf_user_part *part,
static inline uint32_t ocf_evict_do(ocf_cache_t cache,
ocf_queue_t io_queue, const uint32_t evict_cline_no,
ocf_core_id_t core_id, ocf_part_id_t target_part_id)
ocf_part_id_t target_part_id)
{
uint32_t to_evict = 0, evicted = 0;
struct ocf_user_part *part;
@@ -84,7 +84,7 @@ static inline uint32_t ocf_evict_do(ocf_cache_t cache,
}
evicted += ocf_eviction_need_space(cache, io_queue,
part_id, to_evict, core_id);
part_id, to_evict);
}
if (!ocf_eviction_can_evict(cache))
@@ -95,7 +95,7 @@ static inline uint32_t ocf_evict_do(ocf_cache_t cache,
to_evict = ocf_evict_calculate(target_part, evict_cline_no);
if (to_evict) {
evicted += ocf_eviction_need_space(cache, io_queue,
target_part_id, to_evict, core_id);
target_part_id, to_evict);
}
}
@@ -111,9 +111,9 @@ int space_managment_evict_do(struct ocf_cache *cache,
if (evict_cline_no <= cache->device->freelist_part->curr_size)
return LOOKUP_MAPPED;
evict_cline_no = evict_cline_no - cache->device->freelist_part->curr_size;
evict_cline_no -= cache->device->freelist_part->curr_size;
evicted = ocf_evict_do(cache, req->io_queue, evict_cline_no,
req->core_id, req->part_id);
req->part_id);
if (evict_cline_no <= evicted)
return LOOKUP_MAPPED;

View File

@@ -39,7 +39,7 @@ struct eviction_policy_ops {
bool (*can_evict)(ocf_cache_t cache);
uint32_t (*req_clines)(ocf_cache_t cache,
ocf_queue_t io_queue, ocf_part_id_t part_id,
uint32_t cline_no, ocf_core_id_t core_id);
uint32_t cline_no);
void (*hot_cline)(ocf_cache_t cache,
ocf_cache_line_t cline);
void (*init_evp)(ocf_cache_t cache,

View File

@@ -391,7 +391,7 @@ bool evp_lru_can_evict(ocf_cache_t cache)
/* the caller must hold the metadata lock */
uint32_t evp_lru_req_clines(ocf_cache_t cache, ocf_queue_t io_queue,
ocf_part_id_t part_id, uint32_t cline_no, ocf_core_id_t core_id)
ocf_part_id_t part_id, uint32_t cline_no)
{
uint32_t i;
ocf_cache_line_t curr_cline, prev_cline;

View File

@@ -13,8 +13,7 @@ void evp_lru_init_cline(struct ocf_cache *cache,
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_cache *cache, ocf_queue_t io_queue,
ocf_part_id_t part_id, uint32_t cline_no,
ocf_core_id_t core_id);
ocf_part_id_t part_id, uint32_t cline_no);
void evp_lru_hot_cline(struct ocf_cache *cache, ocf_cache_line_t cline);
void evp_lru_init_evp(struct ocf_cache *cache, ocf_part_id_t part_id);
void evp_lru_dirty_cline(struct ocf_cache *cache, ocf_part_id_t part_id, uint32_t cline);

View File

@@ -53,14 +53,11 @@ static inline bool ocf_eviction_can_evict(struct ocf_cache *cache)
}
static inline uint32_t ocf_eviction_need_space(struct ocf_cache *cache,
ocf_queue_t io_queue, ocf_part_id_t part_id, uint32_t clines,
ocf_core_id_t core_id)
ocf_queue_t io_queue, ocf_part_id_t part_id, uint32_t clines)
{
uint8_t type;
uint32_t result = 0;
ENV_BUG_ON(core_id >= OCF_CORE_MAX);
type = cache->conf_meta->eviction_policy_type;
ENV_BUG_ON(type >= ocf_eviction_max);
@@ -71,7 +68,7 @@ static inline uint32_t ocf_eviction_need_space(struct ocf_cache *cache,
* eviction lock.
*/
result = evict_policy_ops[type].req_clines(cache, io_queue,
part_id, clines, core_id);
part_id, clines);
}
return result;