bdev/ocf: Remove cleaner queue, use mngt queue instead

Remove unused cleaner IO queue which is not kicked on creation.
While it is not a problem to have it,
the latest OCF code has new parallelize mechanism that uses all the IO queues.
Using an IO queue which is not kicked will hang the system.

After this change SPDK glue is somewhat closer to OCL glue,
both not using a dedicated cleaner IO queue.

Signed-off-by: Amir Haroush <amir.haroush@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Change-Id: I2e8ef0aaf11061d511151865c6062922d7934df2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17065
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Amir Haroush 2023-03-05 22:57:30 +02:00 committed by Jim Harris
parent b13ee3005d
commit 9579995cb3
3 changed files with 9 additions and 48 deletions

View File

@ -300,7 +300,7 @@ vbdev_ocf_cache_ctx_get(struct vbdev_ocf_cache_ctx *ctx)
struct cleaner_priv {
struct spdk_poller *poller;
ocf_queue_t queue;
ocf_queue_t mngt_queue;
uint64_t next_run;
};
@ -309,23 +309,13 @@ cleaner_poll(void *arg)
{
ocf_cleaner_t cleaner = arg;
struct cleaner_priv *priv = ocf_cleaner_get_priv(cleaner);
uint32_t iono = ocf_queue_pending_io(priv->queue);
int i, max = spdk_min(32, iono);
for (i = 0; i < max; i++) {
ocf_queue_run_single(priv->queue);
}
if (spdk_get_ticks() >= priv->next_run) {
ocf_cleaner_run(cleaner, priv->queue);
ocf_cleaner_run(cleaner, priv->mngt_queue);
return SPDK_POLLER_BUSY;
}
if (iono > 0) {
return SPDK_POLLER_BUSY;
} else {
return SPDK_POLLER_IDLE;
}
return SPDK_POLLER_IDLE;
}
static void
@ -336,32 +326,9 @@ cleaner_cmpl(ocf_cleaner_t c, uint32_t interval)
priv->next_run = spdk_get_ticks() + ((interval * spdk_get_ticks_hz()) / 1000);
}
static void
cleaner_queue_kick(ocf_queue_t q)
{
}
static void
cleaner_queue_stop(ocf_queue_t q)
{
struct cleaner_priv *cpriv = ocf_queue_get_priv(q);
if (cpriv) {
spdk_poller_unregister(&cpriv->poller);
free(cpriv);
}
}
const struct ocf_queue_ops cleaner_queue_ops = {
.kick_sync = cleaner_queue_kick,
.kick = cleaner_queue_kick,
.stop = cleaner_queue_stop,
};
static int
vbdev_ocf_ctx_cleaner_init(ocf_cleaner_t c)
{
int rc;
struct cleaner_priv *priv = calloc(1, sizeof(*priv));
ocf_cache_t cache = ocf_cleaner_get_cache(c);
struct vbdev_ocf_cache_ctx *cctx = ocf_cache_get_priv(cache);
@ -370,15 +337,7 @@ vbdev_ocf_ctx_cleaner_init(ocf_cleaner_t c)
return -ENOMEM;
}
rc = vbdev_ocf_queue_create(cache, &priv->queue, &cleaner_queue_ops);
if (rc) {
free(priv);
return rc;
}
ocf_queue_set_priv(priv->queue, priv);
cctx->cleaner_queue = priv->queue;
priv->mngt_queue = cctx->mngt_queue;
ocf_cleaner_set_cmpl(c, cleaner_cmpl);
ocf_cleaner_set_priv(c, priv);
@ -391,7 +350,10 @@ vbdev_ocf_ctx_cleaner_stop(ocf_cleaner_t c)
{
struct cleaner_priv *priv = ocf_cleaner_get_priv(c);
vbdev_ocf_queue_put(priv->queue);
if (priv) {
spdk_poller_unregister(&priv->poller);
free(priv);
}
}
static void

View File

@ -19,7 +19,6 @@ extern ocf_ctx_t vbdev_ocf_ctx;
/* Context of cache instance */
struct vbdev_ocf_cache_ctx {
ocf_queue_t mngt_queue;
ocf_queue_t cleaner_queue;
pthread_mutex_t lock;
env_atomic refcnt;
};

View File

@ -208,7 +208,7 @@ prepare_submit(struct ocf_io *io)
return -EFAULT;
}
if (q == cctx->cleaner_queue || q == cctx->mngt_queue) {
if (q == cctx->mngt_queue) {
io_ctx->ch = base->management_channel;
return 0;
}