qemu-patch-raspberry4/include/block
Stefan Hajnoczi 1f050a4690 aio-posix: extract ppoll(2) and epoll(7) fd monitoring
The ppoll(2) and epoll(7) file descriptor monitoring implementations are
mixed with the core util/aio-posix.c code.  Before adding another
implementation for Linux io_uring, extract out the existing
ones so there is a clear interface and the core code is simpler.

The new interface is AioContext->fdmon_ops, a pointer to a FDMonOps
struct.  See the patch for details.

Semantic changes:
1. ppoll(2) now reflects events from pollfds[] back into AioHandlers
   while we're still on the clock for adaptive polling.  This was
   already happening for epoll(7), so if it's really an issue then we'll
   need to fix both in the future.
2. epoll(7)'s fallback to ppoll(2) while external events are disabled
   was broken when the number of fds exceeded the epoll(7) upgrade
   threshold.  I guess this code path simply wasn't tested and no one
   noticed the bug.  I didn't go out of my way to fix it but the correct
   code is simpler than preserving the bug.

I also took some liberties in removing the unnecessary
AioContext->epoll_available (just check AioContext->epollfd != -1
instead) and AioContext->epoll_enabled (it's implicit if our
AioContext->fdmon_ops callbacks are being invoked) fields.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Link: https://lore.kernel.org/r/20200305170806.1313245-4-stefanha@redhat.com
Message-Id: <20200305170806.1313245-4-stefanha@redhat.com>
2020-03-09 16:41:31 +00:00
..
accounting.h block: add empty account cookie type 2019-10-10 10:56:18 +02:00
aio-wait.h Clean up decorations and whitespace around header guards 2019-05-13 08:58:55 +02:00
aio.h aio-posix: extract ppoll(2) and epoll(7) fd monitoring 2020-03-09 16:41:31 +00:00
aio_task.h block: introduce aio task pool 2019-10-10 10:56:17 +02:00
block-copy.h block/block-copy: increase buffered copy request 2019-10-28 11:22:31 +01:00
block.h qapi: Allow getting flat output from 'query-named-block-nodes' 2020-02-20 16:43:42 +01:00
block_backup.h block/backup: drop unused synchronization interface 2018-12-14 11:52:40 +01:00
block_int.h block: Introduce 'bdrv_reopen_commit_post' step 2020-03-06 17:15:37 +01:00
blockjob.h blockdev: blockdev_mark_auto_del: drop usage of bs->job 2019-06-18 16:41:10 +02:00
blockjob_int.h job: drop job_drain 2019-09-10 08:58:43 +02:00
dirty-bitmap.h bitmap: Enforce maximum bitmap name length 2019-11-18 16:01:34 -06:00
nbd.h qemu-storage-daemon: Add --nbd-server option 2020-03-06 17:21:28 +01:00
nvme.h nvme: fix NSSRS offset in CAP register 2019-11-04 09:21:45 +01:00
qapi.h qapi: Allow getting flat output from 'query-named-block-nodes' 2020-02-20 16:43:42 +01:00
qdict.h block: Factor out qobject_input_visitor_new_flat_confused() 2018-06-15 14:49:44 +02:00
raw-aio.h block/io_uring: implements interfaces for io_uring 2020-01-30 20:59:41 +00:00
snapshot.h block/snapshot: rename Error ** parameter to more common errp 2019-12-18 08:43:19 +01:00
thread-pool.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
throttle-groups.h throttle-groups: fix restart coroutine iothread race 2019-01-24 10:02:28 +00:00
write-threshold.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00