Don't calc free cachelines in per-ioclass stats
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
parent
76148de310
commit
bcfc821068
@ -276,10 +276,7 @@ int ocf_core_io_class_get_stats(ocf_core_t core, ocf_part_id_t part_id,
|
|||||||
struct ocf_stats_io_class *stats)
|
struct ocf_stats_io_class *stats)
|
||||||
{
|
{
|
||||||
ocf_cache_t cache;
|
ocf_cache_t cache;
|
||||||
uint32_t cache_occupancy_total = 0;
|
|
||||||
struct ocf_counters_part *part_stat;
|
struct ocf_counters_part *part_stat;
|
||||||
ocf_core_t i_core;
|
|
||||||
ocf_core_id_t i_core_id;
|
|
||||||
|
|
||||||
OCF_CHECK_NULL(core);
|
OCF_CHECK_NULL(core);
|
||||||
OCF_CHECK_NULL(stats);
|
OCF_CHECK_NULL(stats);
|
||||||
@ -292,11 +289,6 @@ int ocf_core_io_class_get_stats(ocf_core_t core, ocf_part_id_t part_id,
|
|||||||
if (!ocf_part_is_valid(&cache->user_parts[part_id]))
|
if (!ocf_part_is_valid(&cache->user_parts[part_id]))
|
||||||
return -OCF_ERR_IO_CLASS_NOT_EXIST;
|
return -OCF_ERR_IO_CLASS_NOT_EXIST;
|
||||||
|
|
||||||
for_each_core(cache, i_core, i_core_id) {
|
|
||||||
cache_occupancy_total += env_atomic_read(
|
|
||||||
&i_core->runtime_meta->cached_clines);
|
|
||||||
}
|
|
||||||
|
|
||||||
part_stat = &core->counters->part_counters[part_id];
|
part_stat = &core->counters->part_counters[part_id];
|
||||||
|
|
||||||
stats->occupancy_clines = env_atomic_read(&core->runtime_meta->
|
stats->occupancy_clines = env_atomic_read(&core->runtime_meta->
|
||||||
@ -304,8 +296,7 @@ int ocf_core_io_class_get_stats(ocf_core_t core, ocf_part_id_t part_id,
|
|||||||
stats->dirty_clines = env_atomic_read(&core->runtime_meta->
|
stats->dirty_clines = env_atomic_read(&core->runtime_meta->
|
||||||
part_counters[part_id].dirty_clines);
|
part_counters[part_id].dirty_clines);
|
||||||
|
|
||||||
stats->free_clines = cache->conf_meta->cachelines -
|
stats->free_clines = 0;
|
||||||
cache_occupancy_total;
|
|
||||||
|
|
||||||
copy_req_stats(&stats->read_reqs, &part_stat->read_reqs);
|
copy_req_stats(&stats->read_reqs, &part_stat->read_reqs);
|
||||||
copy_req_stats(&stats->write_reqs, &part_stat->write_reqs);
|
copy_req_stats(&stats->write_reqs, &part_stat->write_reqs);
|
||||||
|
@ -229,15 +229,9 @@ static void _ocf_stats_part_fill(ocf_cache_t cache, ocf_part_id_t part_id,
|
|||||||
_lines4k(stats->occupancy_clines, cache_line_size),
|
_lines4k(stats->occupancy_clines, cache_line_size),
|
||||||
_lines4k(cache_size, cache_line_size));
|
_lines4k(cache_size, cache_line_size));
|
||||||
|
|
||||||
if (part_id == PARTITION_DEFAULT) {
|
|
||||||
_set(&usage->free,
|
_set(&usage->free,
|
||||||
_lines4k(stats->free_clines, cache_line_size),
|
_lines4k(stats->free_clines, cache_line_size),
|
||||||
_lines4k(cache_size, cache_line_size));
|
_lines4k(cache_size, cache_line_size));
|
||||||
} else {
|
|
||||||
_set(&usage->free,
|
|
||||||
_lines4k(0, cache_line_size),
|
|
||||||
_lines4k(0, cache_line_size));
|
|
||||||
}
|
|
||||||
|
|
||||||
_set(&usage->clean,
|
_set(&usage->clean,
|
||||||
_lines4k(stats->occupancy_clines - stats->dirty_clines,
|
_lines4k(stats->occupancy_clines - stats->dirty_clines,
|
||||||
|
Loading…
Reference in New Issue
Block a user