Evict request's target partition in regrular order
Instead of evicting target partition as the last one, respect eviction priorities Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
parent
e999de7232
commit
21e98a6dbc
@ -83,10 +83,6 @@ static inline uint32_t ocf_evict_do(ocf_cache_t cache,
|
|||||||
/* It seams that no more partition for eviction */
|
/* It seams that no more partition for eviction */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (part_id == target_part->id) {
|
|
||||||
/* Omit targeted, evict from different first */
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (evicted >= evict_cline_no) {
|
if (evicted >= evict_cline_no) {
|
||||||
/* Evicted requested number of cache line, stop */
|
/* Evicted requested number of cache line, stop */
|
||||||
goto out;
|
goto out;
|
||||||
@ -102,18 +98,6 @@ static inline uint32_t ocf_evict_do(ocf_cache_t cache,
|
|||||||
part, to_evict);
|
part, to_evict);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ocf_eviction_can_evict(cache))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
if (evicted < evict_cline_no) {
|
|
||||||
/* Now we can evict form targeted partition */
|
|
||||||
to_evict = ocf_evict_calculate(target_part, evict_cline_no);
|
|
||||||
if (to_evict) {
|
|
||||||
evicted += ocf_eviction_need_space(cache, io_queue,
|
|
||||||
target_part, to_evict);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return evicted;
|
return evicted;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user