From 2e8ae7294ab41d477986430731f8bc21b8fc7605 Mon Sep 17 00:00:00 2001 From: paul luse Date: Wed, 2 Jun 2021 13:23:57 -0400 Subject: [PATCH] lib/idxd: stop polling on the first uncompleted location We already keep a list of outstanding completion locations to poll and were previously polling all of them. New ones are added at the tail and we poll the oldest first from the head so if we break when we find a slot that hasn't completed we can get more work done while the HW finishes. This is a proven performance improvement in limited testing. Signed-off-by: paul luse Change-Id: Icc15041605586f9a31435d447d253c381c00b1f8 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8161 Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Ziye Yang Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot --- lib/idxd/idxd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c index 1b58955d2..9d85a4518 100644 --- a/lib/idxd/idxd.c +++ b/lib/idxd/idxd.c @@ -1070,6 +1070,13 @@ spdk_idxd_process_events(struct spdk_idxd_io_channel *chan) _free_batch(comp_ctx->batch, chan); } } + } else { + /* + * oldest locations are at the head of the list so if + * we've polled a location that hasn't completed, bail + * now as there are unlikely to be any more completions. + */ + break; } } return rc;