Reset per-partition counters when adding core

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2021-02-03 03:48:57 -05:00
parent 3543f5c5cc
commit 93eccc862a

View File

@ -353,7 +353,7 @@ static void ocf_mngt_cache_add_core_insert(ocf_pipeline_t pipeline,
ocf_seq_no_t core_sequence_no; ocf_seq_no_t core_sequence_no;
ocf_cleaning_t clean_type; ocf_cleaning_t clean_type;
uint64_t length; uint64_t length;
int result = 0; int i, result = 0;
ocf_cache_log(cache, log_debug, "Inserting core %s\n", cfg->name); ocf_cache_log(cache, log_debug, "Inserting core %s\n", cfg->name);
@ -433,6 +433,13 @@ static void ocf_mngt_cache_add_core_insert(ocf_pipeline_t pipeline,
env_atomic_set(&core->runtime_meta->dirty_clines, 0); env_atomic_set(&core->runtime_meta->dirty_clines, 0);
env_atomic64_set(&core->runtime_meta->dirty_since, 0); env_atomic64_set(&core->runtime_meta->dirty_since, 0);
for (i = 0; i != OCF_IO_CLASS_MAX; i++) {
env_atomic_set(&core->runtime_meta->
part_counters[i].cached_clines, 0);
env_atomic_set(&core->runtime_meta->
part_counters[i].dirty_clines, 0);
}
/* In metadata mark data this core was added into cache */ /* In metadata mark data this core was added into cache */
env_bit_set(core_id, cache->conf_meta->valid_core_bitmap); env_bit_set(core_id, cache->conf_meta->valid_core_bitmap);
core->conf_meta->valid = true; core->conf_meta->valid = true;