bdev/delay: Return poller status based on completions number
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com> Change-Id: I54d4a41602f678aed4d2df61d7059adc1ae37f78 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3235 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
5550beb879
commit
b1bb9917a9
@ -165,16 +165,18 @@ vbdev_delay_destruct(void *ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
_process_io_stailq(void *arg, uint64_t ticks)
|
||||
{
|
||||
STAILQ_HEAD(, delay_bdev_io) *head = arg;
|
||||
struct delay_bdev_io *io_ctx, *tmp;
|
||||
int completions = 0;
|
||||
|
||||
STAILQ_FOREACH_SAFE(io_ctx, head, link, tmp) {
|
||||
if (io_ctx->completion_tick <= ticks) {
|
||||
STAILQ_REMOVE(head, io_ctx, delay_bdev_io, link);
|
||||
spdk_bdev_io_complete(spdk_bdev_io_from_ctx(io_ctx), io_ctx->status);
|
||||
completions++;
|
||||
} else {
|
||||
/* In the general case, I/O will become ready in an fifo order. When timeouts are dynamically
|
||||
* changed, this is not necessarily the case. However, the normal behavior will be restored
|
||||
@ -186,6 +188,8 @@ _process_io_stailq(void *arg, uint64_t ticks)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return completions;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -193,13 +197,14 @@ _delay_finish_io(void *arg)
|
||||
{
|
||||
struct delay_io_channel *delay_ch = arg;
|
||||
uint64_t ticks = spdk_get_ticks();
|
||||
int completions = 0;
|
||||
|
||||
_process_io_stailq(&delay_ch->avg_read_io, ticks);
|
||||
_process_io_stailq(&delay_ch->avg_write_io, ticks);
|
||||
_process_io_stailq(&delay_ch->p99_read_io, ticks);
|
||||
_process_io_stailq(&delay_ch->p99_write_io, ticks);
|
||||
completions += _process_io_stailq(&delay_ch->avg_read_io, ticks);
|
||||
completions += _process_io_stailq(&delay_ch->avg_write_io, ticks);
|
||||
completions += _process_io_stailq(&delay_ch->p99_read_io, ticks);
|
||||
completions += _process_io_stailq(&delay_ch->p99_write_io, ticks);
|
||||
|
||||
return SPDK_POLLER_BUSY;
|
||||
return completions == 0 ? SPDK_POLLER_IDLE : SPDK_POLLER_BUSY;
|
||||
}
|
||||
|
||||
/* Completion callback for IO that were issued from this bdev. The original bdev_io
|
||||
|
Loading…
x
Reference in New Issue
Block a user