aio: avoid extra ctx->poll_lock grab if polling is irq-less aio-poll.v1
authorJens Axboe <axboe@kernel.dk>
Sun, 18 Nov 2018 23:21:28 +0000 (16:21 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 19 Nov 2018 19:07:07 +0000 (12:07 -0700)
commitd43c5c837973333a081f31dff385f75a44d1e408
treeb9906f45cc917c96c31775fbec40e2355e53f428
parent2e969967a5d167847f9bcddbeefb5fd332fc9c44
aio: avoid extra ctx->poll_lock grab if polling is irq-less

Add a task_struct member, aio_task_data, which can be used to
stash completion events. This is where all events will wind up,
if polled IO completions are never done from an interrupt. With
that, we can avoid an extra io_context poll lock grab when off
io_getevents().

The exception being if we have multiple io_contexts banging on
the same device, then we could be finding events that are not
for us. If that's the case, we just fallback to stashing
completion events on the io_context poll_done list, like we
did before (and still do for IRQ driven event completions).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/aio.c
include/linux/sched.h