Re: [PATCH 7/9] aio: add delayed cancel support
From: Greg KH <gregkh@linuxfoundation.org>
Date: 2018-03-21 09:18:46
Also in:
linux-fsdevel, lkml
From: Greg KH <gregkh@linuxfoundation.org>
Date: 2018-03-21 09:18:46
Also in:
linux-fsdevel, lkml
On Wed, Mar 21, 2018 at 08:32:30AM +0100, Christoph Hellwig wrote:
The upcoming aio poll support would like to be able to complete the iocb inline from the cancellation context, but that would cause a lock order reversal. Add support for optionally moving the cancelation outside the context lock to avoid this reversal. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Jeff Moyer <redacted> --- fs/aio.c | 49 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-)diff --git a/fs/aio.c b/fs/aio.c index 0b6394b4e528..9d7d6e4cde87 100644 --- a/fs/aio.c +++ b/fs/aio.c@@ -170,6 +170,10 @@ struct aio_kiocb { struct list_head ki_list; /* the aio core uses this * for cancellation */ + unsigned int flags; /* protected by ctx->ctx_lock */ +#define AIO_IOCB_DELAYED_CANCEL (1 << 0) +#define AIO_IOCB_CANCELLED (1 << 1)
BIT(0) and BIT(1)? Anyway, not a big deal... Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -- To unsubscribe, send a message with 'unsubscribe linux-aio' in the body to majordomo@kvack.org. For more info on Linux AIO, see: http://www.kvack.org/aio/ Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>