Skip to content

Commit

Permalink
Merge pull request #449 from mmichal10/v20.12.1-ioclass-stats-fix
Browse files Browse the repository at this point in the history
[v20.12.1] Reset per-partition counters when adding core
  • Loading branch information
Robert Baldyga authored Feb 3, 2021
2 parents 6af1cf8 + 2263eaa commit 087dbd1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/mngt/ocf_mngt_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 087dbd1

Please sign in to comment.