Service WA write misses in WI engine
WA write must follow follow the same two-pass pattern as WI does. This change modifies WA engine to default to WI in case of any miss (either partial or full), not only partial miss. Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
parent
91b6098fda
commit
b232f2b633
@ -14,28 +14,6 @@
|
|||||||
#define OCF_ENGINE_DEBUG_IO_NAME "wa"
|
#define OCF_ENGINE_DEBUG_IO_NAME "wa"
|
||||||
#include "engine_debug.h"
|
#include "engine_debug.h"
|
||||||
|
|
||||||
static void _ocf_read_wa_complete(struct ocf_request *req, int error)
|
|
||||||
{
|
|
||||||
if (error)
|
|
||||||
req->error |= error;
|
|
||||||
|
|
||||||
if (env_atomic_dec_return(&req->req_remaining))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (req->error) {
|
|
||||||
req->info.core_error = 1;
|
|
||||||
ocf_core_stats_core_error_update(req->core, OCF_WRITE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Complete request */
|
|
||||||
req->complete(req, req->error);
|
|
||||||
|
|
||||||
OCF_DEBUG_RQ(req, "Completion");
|
|
||||||
|
|
||||||
/* Release OCF request */
|
|
||||||
ocf_req_put(req);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ocf_write_wa(struct ocf_request *req)
|
int ocf_write_wa(struct ocf_request *req)
|
||||||
{
|
{
|
||||||
ocf_io_start(&req->ioi.io);
|
ocf_io_start(&req->ioi.io);
|
||||||
@ -58,26 +36,11 @@ int ocf_write_wa(struct ocf_request *req)
|
|||||||
/* There is HIT, do WT */
|
/* There is HIT, do WT */
|
||||||
ocf_get_io_if(ocf_cache_mode_wt)->write(req);
|
ocf_get_io_if(ocf_cache_mode_wt)->write(req);
|
||||||
|
|
||||||
} else if (ocf_engine_mapped_count(req)) {
|
} else {
|
||||||
ocf_req_clear(req);
|
ocf_req_clear(req);
|
||||||
|
|
||||||
/* Partial MISS, do WI */
|
/* MISS, do WI */
|
||||||
ocf_get_io_if(ocf_cache_mode_wi)->write(req);
|
ocf_get_io_if(ocf_cache_mode_wi)->write(req);
|
||||||
} else {
|
|
||||||
|
|
||||||
/* There is no mapped cache line, write directly into core */
|
|
||||||
|
|
||||||
OCF_DEBUG_RQ(req, "Submit");
|
|
||||||
|
|
||||||
/* Submit write IO to the core */
|
|
||||||
env_atomic_set(&req->req_remaining, 1);
|
|
||||||
ocf_submit_volume_req(&req->core->volume, req,
|
|
||||||
_ocf_read_wa_complete);
|
|
||||||
|
|
||||||
/* Update statistics */
|
|
||||||
ocf_engine_update_block_stats(req);
|
|
||||||
ocf_core_stats_request_pt_update(req->core, req->part_id, req->rw,
|
|
||||||
req->info.hit_no, req->core_line_count);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put OCF request - decrease reference counter */
|
/* Put OCF request - decrease reference counter */
|
||||||
|
Loading…
Reference in New Issue
Block a user