Remove partition list

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2021-04-25 04:01:25 +02:00
parent 87f834c793
commit 4f217b91a5
41 changed files with 556 additions and 2119 deletions

View File

@@ -790,23 +790,6 @@ bool ocf_alock_waitlist_is_empty(struct ocf_alock *alock,
return empty;
}
/* NOTE: it is caller responsibility to assure that noone acquires
* a lock in background */
bool ocf_alock_is_locked_exclusively(struct ocf_alock *alock,
ocf_cache_line_t entry)
{
env_atomic *access = &alock->access[entry];
int val = env_atomic_read(access);
ENV_BUG_ON(val == OCF_CACHE_LINE_ACCESS_IDLE);
if (!ocf_alock_waitlist_is_empty(alock, entry))
return false;
return val == OCF_CACHE_LINE_ACCESS_ONE_RD ||
val == OCF_CACHE_LINE_ACCESS_WR;
}
uint32_t ocf_alock_waitlist_count(struct ocf_alock *alock)
{
return env_atomic_read(&alock->waiting);

View File

@@ -53,9 +53,6 @@ int ocf_alock_lock_wr(struct ocf_alock *alock,
bool ocf_alock_waitlist_is_empty(struct ocf_alock *alock,
ocf_cache_line_t entry);
bool ocf_alock_is_locked_exclusively(struct ocf_alock *alock,
ocf_cache_line_t entry);
uint32_t ocf_alock_waitlist_count(struct ocf_alock *alock);
size_t ocf_alock_obj_size(void);

View File

@@ -27,9 +27,11 @@ static int ocf_user_part_lst_cmp_valid(struct ocf_cache *cache,
struct ocf_user_part *p2 = container_of(e2, struct ocf_user_part,
lst_valid);
size_t p1_size = ocf_cache_is_device_attached(cache) ?
p1->part.runtime->curr_size : 0;
env_atomic_read(&p1->part.runtime->curr_size)
: 0;
size_t p2_size = ocf_cache_is_device_attached(cache) ?
p2->part.runtime->curr_size : 0;
env_atomic_read(&p2->part.runtime->curr_size)
: 0;
int v1 = p1->config->priority;
int v2 = p2->config->priority;
@@ -104,11 +106,11 @@ void ocf_user_part_move(struct ocf_request *req)
}
/* Moving cachelines to another partition is needed only
* for those already mapped before this request, which
* indicates either HIT or REMAPPED.
* for those already mapped before this request and remapped
* cachelines are assigned to target partition during eviction.
* So only hit cachelines are interesting.
*/
if (entry->status != LOOKUP_HIT &&
entry->status != LOOKUP_REMAPPED) {
if (entry->status != LOOKUP_HIT) {
/* No HIT */
continue;
}
@@ -127,9 +129,6 @@ void ocf_user_part_move(struct ocf_request *req)
continue;
}
/* Remove from old eviction */
ocf_eviction_purge_cache_line(cache, line);
if (metadata_test_dirty(cache, line)) {
/*
* Remove cline from cleaning - this if for ioclass
@@ -142,13 +141,8 @@ void ocf_user_part_move(struct ocf_request *req)
purge_cache_block(cache, line);
}
/* Let's change partition */
ocf_metadata_remove_from_partition(cache, id_old, line);
ocf_metadata_add_to_partition(cache, id_new, line);
/* Add to new eviction */
ocf_eviction_init_cache_line(cache, line);
ocf_eviction_set_hot_cache_line(cache, line);
ocf_lru_repart(cache, line, &cache->user_parts[id_old].part,
&cache->user_parts[id_new].part);
/* Check if cache line is dirty. If yes then need to change
* cleaning policy and update partition dirty clines

View File

@@ -53,7 +53,7 @@ static inline ocf_part_id_t ocf_user_part_class2id(ocf_cache_t cache, uint64_t c
static inline uint32_t ocf_part_get_occupancy(struct ocf_part *part)
{
return part->runtime->curr_size;
return env_atomic_read(&part->runtime->curr_size);
}
static inline uint32_t ocf_user_part_get_min_size(ocf_cache_t cache,