Merge pull request #530 from arutk/remove_eviction
Remove remaining stale references to "eviction" and "evp"
This commit is contained in:
commit
aa3677da10
@ -10,12 +10,12 @@
|
|||||||
int ocf_metadata_concurrency_init(struct ocf_metadata_lock *metadata_lock)
|
int ocf_metadata_concurrency_init(struct ocf_metadata_lock *metadata_lock)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
unsigned evp_iter;
|
unsigned lru_iter;
|
||||||
unsigned part_iter;
|
unsigned part_iter;
|
||||||
unsigned global_iter;
|
unsigned global_iter;
|
||||||
|
|
||||||
for (evp_iter = 0; evp_iter < OCF_NUM_LRU_LISTS; evp_iter++)
|
for (lru_iter = 0; lru_iter < OCF_NUM_LRU_LISTS; lru_iter++)
|
||||||
env_rwlock_init(&metadata_lock->lru[evp_iter]);
|
env_rwlock_init(&metadata_lock->lru[lru_iter]);
|
||||||
|
|
||||||
for (global_iter = 0; global_iter < OCF_NUM_GLOBAL_META_LOCKS;
|
for (global_iter = 0; global_iter < OCF_NUM_GLOBAL_META_LOCKS;
|
||||||
global_iter++) {
|
global_iter++) {
|
||||||
@ -40,8 +40,8 @@ global_err:
|
|||||||
while (global_iter--)
|
while (global_iter--)
|
||||||
env_rwsem_destroy(&metadata_lock->global[global_iter].sem);
|
env_rwsem_destroy(&metadata_lock->global[global_iter].sem);
|
||||||
|
|
||||||
while (evp_iter--)
|
while (lru_iter--)
|
||||||
env_rwlock_destroy(&metadata_lock->lru[evp_iter]);
|
env_rwlock_destroy(&metadata_lock->lru[lru_iter]);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ static inline bool ocf_engine_needs_repart(struct ocf_request *req)
|
|||||||
* @param req OCF request
|
* @param req OCF request
|
||||||
*
|
*
|
||||||
* @retval true request is mapped fully
|
* @retval true request is mapped fully
|
||||||
* @retval false request is not mapped fully and eviction might be run in
|
* @retval false request is not mapped fully and remap might be run in
|
||||||
* order to complete mapping
|
* order to complete mapping
|
||||||
*/
|
*/
|
||||||
static inline bool ocf_engine_is_mapped(struct ocf_request *req)
|
static inline bool ocf_engine_is_mapped(struct ocf_request *req)
|
||||||
@ -226,9 +226,10 @@ struct ocf_engine_callbacks
|
|||||||
*
|
*
|
||||||
* @param req OCF request
|
* @param req OCF request
|
||||||
*
|
*
|
||||||
* @returns eviction status
|
* @returns cacheline lock status
|
||||||
* @retval LOOKUP_INSERTED successfully evicted required number of cachelines
|
* @retval OCF_LOCK_ACQUIRED in case of success and CLs locked
|
||||||
* @retval LOOKUP_MISS eviction failure
|
* @retval OCF_LOCK_NOT_ACQUIRED in case of success and waiting for CL lock
|
||||||
|
* @retval <0 other error code
|
||||||
*/
|
*/
|
||||||
int ocf_engine_prepare_clines(struct ocf_request *req);
|
int ocf_engine_prepare_clines(struct ocf_request *req);
|
||||||
|
|
||||||
|
@ -105,8 +105,6 @@ struct ocf_cache {
|
|||||||
env_atomic pending_read_misses_list_blocked;
|
env_atomic pending_read_misses_list_blocked;
|
||||||
env_atomic pending_read_misses_list_count;
|
env_atomic pending_read_misses_list_count;
|
||||||
|
|
||||||
env_atomic pending_eviction_clines;
|
|
||||||
|
|
||||||
env_atomic flush_in_progress;
|
env_atomic flush_in_progress;
|
||||||
env_mutex flush_mutex;
|
env_mutex flush_mutex;
|
||||||
|
|
||||||
|
@ -633,7 +633,7 @@ void ocf_lru_clean(ocf_cache_t cache, struct ocf_user_part *user_part,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctx->cache = cache;
|
ctx->cache = cache;
|
||||||
lru_idx = io_queue->eviction_idx++ % OCF_NUM_LRU_LISTS;
|
lru_idx = io_queue->lru_idx++ % OCF_NUM_LRU_LISTS;
|
||||||
|
|
||||||
lock_idx = ocf_metadata_concurrency_next_idx(io_queue);
|
lock_idx = ocf_metadata_concurrency_next_idx(io_queue);
|
||||||
ocf_metadata_start_shared_access(&cache->metadata.lock, lock_idx);
|
ocf_metadata_start_shared_access(&cache->metadata.lock, lock_idx);
|
||||||
@ -658,16 +658,6 @@ void ocf_lru_clean(ocf_cache_t cache, struct ocf_user_part *user_part,
|
|||||||
ocf_cleaner_fire(cache, &attribs);
|
ocf_cleaner_fire(cache, &attribs);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ocf_lru_can_evict(ocf_cache_t cache)
|
|
||||||
{
|
|
||||||
if (env_atomic_read(&cache->pending_eviction_clines) >=
|
|
||||||
OCF_PENDING_EVICTION_LIMIT) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ocf_lru_invalidate(ocf_cache_t cache, ocf_cache_line_t cline,
|
static void ocf_lru_invalidate(ocf_cache_t cache, ocf_cache_line_t cline,
|
||||||
ocf_core_id_t core_id, ocf_part_id_t part_id)
|
ocf_core_id_t core_id, ocf_part_id_t part_id)
|
||||||
{
|
{
|
||||||
@ -725,15 +715,12 @@ uint32_t ocf_lru_req_clines(struct ocf_request *req,
|
|||||||
ENV_BUG_ON(req->part_id == PARTITION_FREELIST);
|
ENV_BUG_ON(req->part_id == PARTITION_FREELIST);
|
||||||
dst_part = &cache->user_parts[req->part_id].part;
|
dst_part = &cache->user_parts[req->part_id].part;
|
||||||
|
|
||||||
lru_idx = req->io_queue->eviction_idx++ % OCF_NUM_LRU_LISTS;
|
lru_idx = req->io_queue->lru_idx++ % OCF_NUM_LRU_LISTS;
|
||||||
|
|
||||||
lru_iter_eviction_init(&iter, cache, src_part, lru_idx, req);
|
lru_iter_eviction_init(&iter, cache, src_part, lru_idx, req);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < cline_no) {
|
while (i < cline_no) {
|
||||||
if (!ocf_lru_can_evict(cache))
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (src_part->id != PARTITION_FREELIST) {
|
if (src_part->id != PARTITION_FREELIST) {
|
||||||
cline = lru_iter_eviction_next(&iter, dst_part, &core_id,
|
cline = lru_iter_eviction_next(&iter, dst_part, &core_id,
|
||||||
&core_line);
|
&core_line);
|
||||||
|
@ -18,8 +18,8 @@ struct ocf_queue {
|
|||||||
/* per-queue free running global metadata lock index */
|
/* per-queue free running global metadata lock index */
|
||||||
unsigned lock_idx;
|
unsigned lock_idx;
|
||||||
|
|
||||||
/* per-queue free running eviction list index */
|
/* per-queue free running lru list index */
|
||||||
unsigned eviction_idx;
|
unsigned lru_idx;
|
||||||
|
|
||||||
struct ocf_seq_cutoff *seq_cutoff;
|
struct ocf_seq_cutoff *seq_cutoff;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "ocf/ocf_debug.h"
|
#include "ocf/ocf_debug.h"
|
||||||
#include "utils/utils_cache_line.h"
|
#include "utils/utils_cache_line.h"
|
||||||
|
|
||||||
#define SEQ_CUTOFF_FULL_MARGIN OCF_PENDING_EVICTION_LIMIT
|
#define SEQ_CUTOFF_FULL_MARGIN 512
|
||||||
|
|
||||||
static inline bool ocf_seq_cutoff_is_on(ocf_cache_t cache,
|
static inline bool ocf_seq_cutoff_is_on(ocf_cache_t cache,
|
||||||
struct ocf_request *req)
|
struct ocf_request *req)
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
#include "ocf_lru.h"
|
#include "ocf_lru.h"
|
||||||
#include "ocf_lru_structs.h"
|
#include "ocf_lru_structs.h"
|
||||||
|
|
||||||
#define OCF_PENDING_EVICTION_LIMIT 512UL
|
|
||||||
|
|
||||||
#define OCF_NUM_LRU_LISTS 32
|
#define OCF_NUM_LRU_LISTS 32
|
||||||
|
|
||||||
struct ocf_part;
|
struct ocf_part;
|
||||||
|
@ -45,7 +45,7 @@ static void __set_cache_line_invalid(struct ocf_cache *cache, uint8_t start_bit,
|
|||||||
*/
|
*/
|
||||||
if (!is_valid && !ocf_cache_line_are_waiters(
|
if (!is_valid && !ocf_cache_line_are_waiters(
|
||||||
ocf_cache_line_concurrency(cache), line)) {
|
ocf_cache_line_concurrency(cache), line)) {
|
||||||
ocf_purge_eviction_policy(cache, line);
|
ocf_lru_rm_cline(cache, line);
|
||||||
ocf_metadata_remove_cache_line(cache, line);
|
ocf_metadata_remove_cache_line(cache, line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,18 +170,6 @@ static inline void ocf_purge_cleaning_policy(struct ocf_cache *cache,
|
|||||||
cleaning_policy_ops[clean_type].purge_cache_block(cache, line);
|
cleaning_policy_ops[clean_type].purge_cache_block(cache, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Remove cache line from eviction policy
|
|
||||||
*
|
|
||||||
* @param cache - cache instance
|
|
||||||
* @param line - cache line to be removed
|
|
||||||
*/
|
|
||||||
static inline void ocf_purge_eviction_policy(struct ocf_cache *cache,
|
|
||||||
ocf_cache_line_t line)
|
|
||||||
{
|
|
||||||
ocf_lru_rm_cline(cache, line);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set cache line clean and invalid and remove form lists
|
* @brief Set cache line clean and invalid and remove form lists
|
||||||
*
|
*
|
||||||
@ -206,8 +194,8 @@ static inline void _ocf_purge_cache_line_sec(struct ocf_cache *cache,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Purge cache line (remove completely, from collision, move to free
|
* @brief Purge cache line (remove from collision and cleaning policy,
|
||||||
* partition, from cleaning policy and eviction policy)
|
* move to free LRU list).
|
||||||
*
|
*
|
||||||
* @param req - OCF request to purge
|
* @param req - OCF request to purge
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user