Skip automatic zero-init of large arrays / structs in I/O paths
Status from this message: Thanks, applied to my block tree:
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
Reviews trailers per patch
3 of 31 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Stefan Hajnoczi | Klaus Jensen | Harsh Prateek Bora |
|---|---|---|---|
| Series | R-b | ||
| 1/31 | |||
| 2/31 | |||
| 3/31 | |||
| 4/31 | |||
| 5/31 | |||
| 6/31 | |||
| 7/31 | |||
| 8/31 | |||
| 9/31 | |||
| 10/31 | |||
| 11/31 | |||
| 12/31 | |||
| 13/31 | |||
| 14/31 | |||
| 15/31 | |||
| 16/31 | |||
| 17/31 | |||
| 18/31 | |||
| 19/31 | |||
| 20/31 | |||
| 21/31 | |||
| 22/31 | |||
| 23/31 | R-b | ||
| 24/31 | R-b | ||
| 25/31 | R-b | ||
| 26/31 | |||
| 27/31 | |||
| 28/31 | |||
| 29/31 | |||
| 30/31 | |||
| 31/31 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH 00/31] Skip automatic zero-init of large arrays / structs in I/O paths
This series is an extension of Stefan's proposal:
https://lists.nongnu.org/archive/html/qemu-devel/2025-06/msg00736.html
It used '-Wframe-larger-than=4096' to identify all code locations with more than 4k on the stack. Any locations in the I/O paths were chosen to avoid automatic zero-init, to eliminate the performance overhead of the automatic initialization.
Note, although all the changed locations are I/O paths, this does not imply that the changes make a measurement performance difference in every case.
This is because many of the emulated devices are likely limited by the emulation impl, rather than any implicit memory zero'ing overhead of stack data.
None the less the memory zero'ing is still a redundant CPU burn in all these cases, so I felt it worth setting the general precedent that any data over 4k on a stack in a device I/O path should be skipping zero-init.
I did reasonable review in each case to identify that the data was indeed initialized explicitly later in the method.
Daniel P. Berrangé (29):
block: skip automatic zero-init of large array in ioq_submit chardev/char-fd: skip automatic zero-init of large array chardev/char-pty: skip automatic zero-init of large array chardev/char-socket: skip automatic zero-init of large array hw/audio/ac97: skip automatic zero-init of large arrays hw/audio/cs4231a: skip automatic zero-init of large arrays hw/audio/es1370: skip automatic zero-init of large array hw/audio/gus: skip automatic zero-init of large array hw/audio/gus: skip automatic zero-init of large array hw/audio/sb16: skip automatic zero-init of large array hw/audio/via-ac97: skip automatic zero-init of large array hw/char/sclpconsole-lm: skip automatic zero-init of large array hw/dma/xlnx_csu_dma: skip automatic zero-init of large array hw/display/vmware_vga: skip automatic zero-init of large struct hw/hyperv/syndbg: skip automatic zero-init of large array hw/misc/aspeed_hace: skip automatic zero-init of large array hw/net/rtl8139: skip automatic zero-init of large array hw/net/tulip: skip automatic zero-init of large array hw/net/virtio-net: skip automatic zero-init of large arrays hw/net/xgamc: skip automatic zero-init of large array hw/nvme/ctrl: skip automatic zero-init of large arrays hw/ppc/pnv_occ: skip automatic zero-init of large struct hw/ppc/spapr_tpm_proxy: skip automatic zero-init of large arrays hw/usb/hcd-ohci: skip automatic zero-init of large array hw/scsi/lsi53c895a: skip automatic zero-init of large array hw/scsi/megasas: skip automatic zero-init of large arrays hw/ufs/lu: skip automatic zero-init of large array net/socket: skip automatic zero-init of large array net/stream: skip automatic zero-init of large array
Stefan Hajnoczi (2):
include/qemu/compiler: add QEMU_UNINITIALIZED attribute macro hw/virtio/virtio: avoid cost of -ftrivial-auto-var-init in hot path
block/linux-aio.c | 2 +- chardev/char-fd.c | 2 +- chardev/char-pty.c | 2 +- chardev/char-socket.c | 2 +- hw/audio/ac97.c | 4 ++-- hw/audio/cs4231a.c | 4 ++-- hw/audio/es1370.c | 2 +- hw/audio/gus.c | 2 +- hw/audio/marvell_88w8618.c | 2 +- hw/audio/sb16.c | 2 +- hw/audio/via-ac97.c | 2 +- hw/char/sclpconsole-lm.c | 2 +- hw/display/vmware_vga.c | 2 +- hw/dma/xlnx_csu_dma.c | 2 +- hw/hyperv/syndbg.c | 2 +- hw/misc/aspeed_hace.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/tulip.c | 2 +- hw/net/virtio-net.c | 6 +++--- hw/net/xgmac.c | 2 +- hw/nvme/ctrl.c | 6 +++--- hw/ppc/pnv_occ.c | 2 +- hw/ppc/spapr_tpm_proxy.c | 4 ++-- hw/scsi/lsi53c895a.c | 2 +- hw/scsi/megasas.c | 7 ++----- hw/ufs/lu.c | 2 +- hw/usb/hcd-ohci.c | 2 +- hw/virtio/virtio.c | 8 ++++---- include/qemu/compiler.h | 20 ++++++++++++++++++++ net/socket.c | 2 +- net/stream.c | 2 +- 31 files changed, 61 insertions(+), 44 deletions(-)
Signature · 1 line
2.49.0