Re: [PATCH 28/32] aio: simplify cancellation

From: Jeff Moyer
Date: Wed Jan 10 2018 - 17:50:53 EST


Christoph Hellwig <hch@xxxxxx> writes:

> With the current aio code there is no need for the magic KIOCB_CANCELLED
> value, as a cancelation just kicks the driver to queue the completion
> ASAP, with all actual completion handling done in another thread. Given
> that both the completion path and cancelation take the context lock there
> is no need for magic cmpxchg loops either.

The cmpxchg was made unnecessary when the complementary xchg was removed
in commit bec68faaf ("aio: io_cancel() no longer returns the io_event").
There was no longer a need to ensure only the completion path or the
cancellation path delivered the completion event. Now, the completion
is always delivered via aio_complete.

So yeah, we can get rid of this.

Acked-by: Jeff Moyer <jmoyer@xxxxxxxxxx>