From 43ebecdf60f09982ba67af0dd043b697f139972e Mon Sep 17 00:00:00 2001 From: "Chen, You" Date: Fri, 15 Jul 2022 23:56:57 +0800 Subject: [PATCH] lib/idxd: break spdk_idxd_process_events loop after processing DESC_PER_BATCH ops To prevent the processing of outstanding commands from starving the rest of the system Fixes: #2586 Signed-off-by: Chen, You Signed-off-by: Changpeng Liu Change-Id: I392db2359408cdef32cc1f46b76ecd94f0c3332c Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13685 Reviewed-by: Ben Walker Reviewed-by: Dong Yi Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins --- lib/idxd/idxd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c index d94bd39f1..9db2d9723 100644 --- a/lib/idxd/idxd.c +++ b/lib/idxd/idxd.c @@ -1397,6 +1397,10 @@ spdk_idxd_process_events(struct spdk_idxd_io_channel *chan) /* reset the status */ status = 0; + /* break the processing loop to prevent from starving the rest of the system */ + if (rc > DESC_PER_BATCH) { + break; + } } /* Submit any built-up batch */