From 116f42add040dfa1eaf25087db1038f8c4198bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 10 Jun 2025 13:36:41 +0100 Subject: [PATCH 11/43] block: skip automatic zero-init of large array in ioq_submit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RH-Author: Stefan Hajnoczi RH-MergeRequest: 381: Solve -ftrivial-auto-var-init performance regression with QEMU_UNINITIALIZED RH-Jira: RHEL-95479 RH-Acked-by: Miroslav Rezanina RH-Commit: [3/31] 3d4c81fcc56f1c7a4d1d3819214bd6296edc2a1e (stefanha/centos-stream-qemu-kvm) The 'ioq_submit' method has a struct array that is 8k in size. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'iocbs' array will selectively initialized when processing the I/O data. Signed-off-by: Daniel P. Berrangé Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-4-berrange@redhat.com Signed-off-by: Stefan Hajnoczi (cherry picked from commit 83750c1da807c973b0b11d977d61df7e41122d03) Signed-off-by: Stefan Hajnoczi --- block/linux-aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/linux-aio.c b/block/linux-aio.c index 407369f5c9..c200e7ad20 100644 --- a/block/linux-aio.c +++ b/block/linux-aio.c @@ -291,7 +291,7 @@ static void ioq_submit(LinuxAioState *s) { int ret, len; struct qemu_laiocb *aiocb; - struct iocb *iocbs[MAX_EVENTS]; + QEMU_UNINITIALIZED struct iocb *iocbs[MAX_EVENTS]; QSIMPLEQ_HEAD(, qemu_laiocb) completed; do { -- 2.39.3