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>
2 files changed