From: Anton Blanchard Date: Mon, 13 Jul 2020 01:34:48 +0000 (+1000) Subject: io_uring: Avoid needless update of completion queue head pointer X-Git-Tag: fio-3.21~11^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=76ce63dd5eb566a4299e00181dfad9c1d109f515;p=fio.git io_uring: Avoid needless update of completion queue head pointer I'm seeing a slowdown in io_uring performance on a POWER9 box when the userspace and kernel polling threads are on two cores that share an L2 cache. fio_ioring_cqring_reap() always stores to the completion queue head pointer, even if nothing was reaped and the value hasn't changed. Changing this to only update the head pointer when it changes results in a 95% improvement in performance on this particular test. Signed-off-by: Anton Blanchard --- diff --git a/engines/io_uring.c b/engines/io_uring.c index cd0810f4..ecff0657 100644 --- a/engines/io_uring.c +++ b/engines/io_uring.c @@ -307,7 +307,9 @@ static int fio_ioring_cqring_reap(struct thread_data *td, unsigned int events, head++; } while (reaped + events < max); - atomic_store_release(ring->head, head); + if (reaped) + atomic_store_release(ring->head, head); + return reaped; }