Use cline concurrency ctx instead of cache

Cacheline concurrency functions have their interface changed
so that the cacheline concurrency private context is
explicitly on the parameter list, rather than being taken
from cache->device->concurrency.cache_line.

Cache pointer is no longer provided as a parameter to these
functions. Cacheline concurrency context now has a pointer
to cache structure (for logging purposes only).

The purpose of this change is to facilitate unit testing.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2021-02-24 17:29:39 -06:00
parent 0f34e46375
commit cf5f82b253
22 changed files with 200 additions and 151 deletions

View File

@@ -396,9 +396,10 @@ static ocf_cache_line_t _acp_trylock_dirty(struct ocf_cache *cache,
core_line);
if (info.status == LOOKUP_HIT &&
metadata_test_dirty(cache, info.coll_idx) &&
ocf_cache_line_try_lock_rd(cache, info.coll_idx)) {
locked = true;
metadata_test_dirty(cache, info.coll_idx)) {
locked = ocf_cache_line_try_lock_rd(
cache->device->concurrency.cache_line,
info.coll_idx);
}
ocf_hb_cline_prot_unlock_rd(&cache->metadata.lock, lock_idx, core_id,
@@ -472,7 +473,9 @@ static void _acp_flush_end(void *priv, int error)
config = (void *)&cache->conf_meta->cleaning[ocf_cleaning_acp].data;
for (i = 0; i < flush->size; i++) {
ocf_cache_line_unlock_rd(cache, flush->data[i].cache_line);
ocf_cache_line_unlock_rd(
cache->device->concurrency.cache_line,
flush->data[i].cache_line);
ACP_DEBUG_END(acp, flush->data[i].cache_line);
}

View File

@@ -682,8 +682,11 @@ static bool block_is_busy(struct ocf_cache *cache,
if (!cache->core[core_id].opened)
return true;
if (ocf_cache_line_is_used(cache, cache_line))
if (ocf_cache_line_is_used(
cache->device->concurrency.cache_line,
cache_line)) {
return true;
}
return false;
}