Evict from overflown pinned ioclass

If an ioclass is pinned but it exceeded its occupancy limit, it should be
evicted anyway.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2021-02-16 03:50:27 -05:00
parent fe206a86ec
commit 7f3f2ad115

View File

@ -62,7 +62,7 @@ static inline uint32_t ocf_evict_part_do(ocf_cache_t cache,
static inline uint32_t ocf_evict_partitions(ocf_cache_t cache, static inline uint32_t ocf_evict_partitions(ocf_cache_t cache,
ocf_queue_t io_queue, uint32_t evict_cline_no, ocf_queue_t io_queue, uint32_t evict_cline_no,
bool overflown_only, uint32_t max_priority) bool overflown_only, int16_t max_priority)
{ {
uint32_t to_evict = 0, evicted = 0; uint32_t to_evict = 0, evicted = 0;
struct ocf_user_part *part; struct ocf_user_part *part;
@ -84,8 +84,9 @@ static inline uint32_t ocf_evict_partitions(ocf_cache_t cache,
*/ */
break; break;
} }
if (!part->config->flags.eviction) { if (!overflown_only && !part->config->flags.eviction) {
/* no more partitions available for viction /* If partition is overflown it should be evcited
* even if its pinned
*/ */
break; break;
} }
@ -132,8 +133,9 @@ static inline uint32_t ocf_evict_do(ocf_cache_t cache,
* priority in this case, as overflown partitions should * priority in this case, as overflown partitions should
* free its cachelines regardless of destination partition * free its cachelines regardless of destination partition
* priority. */ * priority. */
evicted = ocf_evict_partitions(cache, io_queue, evict_cline_no, evicted = ocf_evict_partitions(cache, io_queue, evict_cline_no,
true, OCF_IO_CLASS_PRIO_HIGHEST); true, OCF_IO_CLASS_PRIO_PINNED);
if (evicted >= evict_cline_no) if (evicted >= evict_cline_no)
return evicted; return evicted;
/* Not enough cachelines in overflown partitions. Go through /* Not enough cachelines in overflown partitions. Go through