Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/engine/engine_bf.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static int _ocf_backfill_do(struct ocf_request *req)
addr += req->addr % line_size;

ocf_core_stats_cache_block_update(req->core, req->part_id,
OCF_WRITE, req->bytes);
OCF_WRITE, req->bytes, req->io.pf_id);
ocf_req_forward_cache_io(req, OCF_WRITE, addr, req->bytes,
req->offset);
return 0;
Expand Down Expand Up @@ -158,7 +158,7 @@ static int _ocf_backfill_do(struct ocf_request *req)
bytes = OCF_MIN(bytes, req->bytes - total_bytes);

ocf_core_stats_cache_block_update(req->core, req->part_id,
OCF_WRITE, bytes);
OCF_WRITE, bytes, req->io.pf_id);
ocf_req_forward_cache_io(req, OCF_WRITE, addr, bytes,
req->offset + total_bytes);

Expand Down
6 changes: 3 additions & 3 deletions src/engine/engine_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void ocf_engine_forward_cache_io(struct ocf_request *req, int dir,
addr += (offset + seek) % ocf_line_size(cache);

ocf_core_stats_cache_block_update(req->core, req->part_id,
dir, req->bytes);
dir, req->bytes, req->io.pf_id);

ocf_req_forward_cache_io(req, dir, addr, size,
req->offset + offset);
Expand All @@ -49,7 +49,7 @@ void ocf_engine_forward_cache_io_req(struct ocf_request *req, int dir,
addr += req->addr % ocf_line_size(cache);

ocf_core_stats_cache_block_update(req->core, req->part_id,
dir, req->bytes);
dir, req->bytes, req->io.pf_id);

ocf_req_forward_cache_io(req, dir, addr, req->bytes,
req->offset);
Expand Down Expand Up @@ -98,7 +98,7 @@ void ocf_engine_forward_cache_io_req(struct ocf_request *req, int dir,
ENV_BUG_ON(bytes == 0);

ocf_core_stats_cache_block_update(req->core, req->part_id,
dir, bytes);
dir, bytes, req->io.pf_id);

ocf_req_forward_cache_io(req, dir, addr, bytes,
req->offset + total_bytes);
Expand Down
23 changes: 16 additions & 7 deletions src/ocf_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,35 @@ void ocf_core_stats_vol_block_update(ocf_core_t core, ocf_part_id_t part_id,
}

void ocf_core_stats_cache_block_update(ocf_core_t core, ocf_part_id_t part_id,
int dir, uint64_t bytes)
int dir, uint64_t bytes, ocf_pf_id_t pf_id)
{
struct ocf_counters_block *counters =
&core->counters->part_counters[part_id].cache_blocks;
struct ocf_counters_block *counters;

if (OCF_PF_ID_VALID(pf_id)) {
counters = &core->counters->
part_counters[part_id].prefetch_blocks[pf_id];
} else {
counters = &core->counters->
part_counters[part_id].cache_blocks;
}

_ocf_stats_block_update(counters, dir, bytes);
}

void ocf_core_stats_core_block_update(ocf_core_t core, ocf_part_id_t part_id,
int dir, uint64_t bytes, ocf_pf_id_t pf_id)
{
struct ocf_counters_block *counters =
&core->counters->part_counters[part_id].core_blocks;
struct ocf_counters_block *counters;

_ocf_stats_block_update(counters, dir, bytes);
if (OCF_PF_ID_VALID(pf_id)) {
counters = &core->counters->
part_counters[part_id].prefetch_blocks[pf_id];
_ocf_stats_block_update(counters, dir, bytes);
} else {
counters = &core->counters->
part_counters[part_id].core_blocks;
}

_ocf_stats_block_update(counters, dir, bytes);
}

void ocf_core_stats_pt_block_update(ocf_core_t core, ocf_part_id_t part_id,
Expand Down
2 changes: 1 addition & 1 deletion src/ocf_stats_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ struct ocf_counters_core {
void ocf_core_stats_core_block_update(ocf_core_t core, ocf_part_id_t part_id,
int dir, uint64_t bytes, ocf_pf_id_t pf_id);
void ocf_core_stats_cache_block_update(ocf_core_t core, ocf_part_id_t part_id,
int dir, uint64_t bytes);
int dir, uint64_t bytes, ocf_pf_id_t pf_id);
void ocf_core_stats_vol_block_update(ocf_core_t core, ocf_part_id_t part_id,
int dir, uint64_t bytes);
void ocf_core_stats_pt_block_update(ocf_core_t core, ocf_part_id_t part_id,
Expand Down
2 changes: 1 addition & 1 deletion src/prefetch/ocf_prefetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static bool ocf_pf_next_sub_range_miss(struct ocf_request *req,
return true;
}

void ocf_prefetch_range(struct ocf_request *req, ocf_pf_id_t pf_id,
static void ocf_prefetch_range(struct ocf_request *req, ocf_pf_id_t pf_id,
struct ocf_pf_range *range)
{
struct ocf_request *prefetch_req = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/prefetch/ocf_prefetch_readahead.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ void ocf_pf_readahead_get_range(struct ocf_request *req,
struct ocf_pf_range *range)
{
range->core_line_first = req->core_line_first + req->core_line_count;
range->core_line_count = OCF_MIN(req->core_line_count,
range->core_line_count = OCF_MAX(req->core_line_count,
ocf_bytes_2_lines(req->cache, OCF_PF_READAHEAD_MIN));
}
2 changes: 1 addition & 1 deletion src/utils/utils_cleaner.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ static int _ocf_cleaner_fire_cache(struct ocf_request *req)
part_id = ocf_metadata_get_partition_id(cache, iter->coll_idx);

ocf_core_stats_cache_block_update(req->core, part_id, OCF_READ,
ocf_line_size(cache));
ocf_line_size(cache), ocf_pf_none);

req->addr = iter->core_line * ocf_line_size(cache);

Expand Down
Loading