]> git.proxmox.com Git - mirror_qemu.git/commit
util/defer-call: move defer_call() to util/
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 13 Sep 2023 20:00:43 +0000 (16:00 -0400)
committerKevin Wolf <kwolf@redhat.com>
Tue, 31 Oct 2023 14:41:42 +0000 (15:41 +0100)
commit433fcea40c31ff355f84da22a46977c2a1b596c3
tree47a995db30935c88634c46402b26d736a10d8b73
parentccee48aa736b97f0ce4ab04ad41815f0e575d526
util/defer-call: move defer_call() to util/

The networking subsystem may wish to use defer_call(), so move the code
to util/ where it can be reused.

As a reminder of what defer_call() does:

This API defers a function call within a defer_call_begin()/defer_call_end()
section, allowing multiple calls to batch up. This is a performance
optimization that is used in the block layer to submit several I/O requests
at once instead of individually:

  defer_call_begin(); <-- start of section
  ...
  defer_call(my_func, my_obj); <-- deferred my_func(my_obj) call
  defer_call(my_func, my_obj); <-- another
  defer_call(my_func, my_obj); <-- another
  ...
  defer_call_end(); <-- end of section, my_func(my_obj) is called once

Suggested-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20230913200045.1024233-3-stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 files changed:
MAINTAINERS
block/blkio.c
block/io_uring.c
block/linux-aio.c
block/meson.build
block/nvme.c
block/plug.c [deleted file]
hw/block/dataplane/xen-block.c
hw/block/virtio-blk.c
hw/scsi/virtio-scsi.c
include/qemu/defer-call.h [new file with mode: 0644]
include/sysemu/block-backend-io.h
util/defer-call.c [new file with mode: 0644]
util/meson.build