From 76c73407cb0337e69a8075167799992d930dcd3c Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 11 Nov 2021 13:17:56 -0700 Subject: [PATCH] idxd: free ops to the head of the tailq We allocate from the head, so it's better to free to the head too for better cache utilization. Signed-off-by: Jim Harris Change-Id: I5c32244f446bd7a1df12eefc81245b3ef7e24070 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10193 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: John Kariuki Reviewed-by: Changpeng Liu Reviewed-by: Tomasz Zawadzki --- lib/idxd/idxd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c index 0b5ed96fc..34c950425 100644 --- a/lib/idxd/idxd.c +++ b/lib/idxd/idxd.c @@ -1149,7 +1149,7 @@ spdk_idxd_process_events(struct spdk_idxd_io_channel *chan) if (op->desc->opcode == IDXD_OPCODE_BATCH) { _free_batch(op->batch, chan); } else if (op->batch == NULL) { - TAILQ_INSERT_TAIL(&chan->ops_pool, op, link); + TAILQ_INSERT_HEAD(&chan->ops_pool, op, link); } if (cb_fn) {