Merge pull request #450 from mmichal10/ioclass-stats-fix

Reset per-partition counters when adding core
This commit is contained in:
Robert Baldyga 2021-02-03 13:13:30 +01:00 committed by GitHub
commit fd26735157
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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_cleaning_t clean_type;
uint64_t length;
int result = 0;
int i, result = 0;
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_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 */
env_bit_set(core_id, cache->conf_meta->valid_core_bitmap);
core->conf_meta->valid = true;