Enable particular ioclass eviction

If partition's occupancy limit is reached, cachelines should be evicted from
 request's target partition.

Information whether particular partition eviction should be triggered is
carried as a flag by request which triggered eviction.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk
2020-10-15 18:19:13 -04:00
parent e9d7290078
commit 718dc743c8
2 changed files with 64 additions and 5 deletions

View File

@@ -191,6 +191,9 @@ struct ocf_request {
uint8_t wi_second_pass : 1;
/*!< Set after first pass of WI write is completed */
uint8_t part_evict : 1;
/* !< Some cachelines from request's partition must be evicted */
log_sid_t sid;
/*!< Tracing sequence ID */
@@ -332,6 +335,40 @@ void ocf_req_clear_map(struct ocf_request *req);
*/
void ocf_req_hash(struct ocf_request *req);
/**
* @brief Request should trigger eviction from it's target partition
*
* @param req - OCF request
*/
static inline void ocf_req_set_part_evict(struct ocf_request *req)
{
req->part_evict = true;
}
/**
* @brief Request shouldn't trigger eviction from it's target partition
*
* @param req - OCF request
*/
static inline void ocf_req_clear_part_evict(struct ocf_request *req)
{
req->part_evict = false;
}
/**
* @brief Check wheter request shouldn't trigger eviction from it's target
* partition or any partition
*
* @param req - OCF request
* @return true - Eviciton should be triggered from request's target partition
* @return false - Eviction should be triggered with respect to eviction
* priority
*/
static inline bool ocf_req_part_evict(struct ocf_request *req)
{
return req->part_evict;
}
int ocf_req_set_dirty(struct ocf_request *req);
/**