Change sequential request detection logic

Changing sequential request detection so that a miss request is
recognized as sequential after needed cachelines are evicted
and mapped to the request in a sequential order.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2021-03-05 11:20:46 +01:00
parent 056217d103
commit 3bd0f6b6c4
3 changed files with 77 additions and 43 deletions

View File

@@ -124,6 +124,12 @@ static inline uint32_t ocf_engine_repart_count(struct ocf_request *req)
return req->info.re_part_no;
}
static inline uint32_t ocf_engine_is_sequential(struct ocf_request *req)
{
return req->info.hit_no + req->info.insert_no == req->core_line_count
&& req->info.seq_no == req->core_line_count - 1;
}
/**
* @brief Get number of IOs to perform cache read or write
*
@@ -133,7 +139,7 @@ static inline uint32_t ocf_engine_repart_count(struct ocf_request *req)
*/
static inline uint32_t ocf_engine_io_count(struct ocf_request *req)
{
return req->info.seq_req ? 1 : req->core_line_count;
return ocf_engine_is_sequential(req) ? 1 : req->core_line_count;
}
static inline
@@ -262,12 +268,14 @@ void ocf_engine_traverse(struct ocf_request *req);
int ocf_engine_check(struct ocf_request *req);
/**
* @brief Update OCF request info
* @brief Update OCF request info after evicting a cacheline
*
* @param cache OCF cache instance
* @param req OCF request
* @param idx cacheline index within the request
*/
void ocf_engine_update_req_info(struct ocf_cache *cache,
struct ocf_request *req, uint32_t entry);
void ocf_engine_patch_req_info(struct ocf_cache *cache,
struct ocf_request *req, uint32_t idx);
/**
* @brief Update OCF request block statistics for an exported object