[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 8 Aug 2018 11:57:19 +0200
From: Christoph Hellwig <hch@....de>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Christoph Hellwig <hch@....de>, viro@...iv.linux.org.uk,
Avi Kivity <avi@...lladb.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-aio@...ck.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] aio: allow direct aio poll comletions for keyed
wakeups
On Tue, Aug 07, 2018 at 09:04:41AM -0700, Andrew Morton wrote:
> > Because it is faster obviously. I can update the comment.
>
> I meant the comment could explain why it's a trylock instead of a
> spin_lock().
We could something like this the patch below.
Al, do you want me to resend or can you just fold it in?
diff --git a/fs/aio.c b/fs/aio.c
index 5943098a87c6..84df2c2bf80b 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1684,7 +1684,8 @@ static int aio_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync,
/*
* Try to complete the iocb inline if we can to avoid a costly
- * context switch.
+ * context switch. As the waitqueue lock nests inside the ctx
+ * lock we can only do that if we can get it without waiting.
*/
if (spin_trylock(&iocb->ki_ctx->ctx_lock)) {
list_del(&iocb->ki_list);
Powered by blists - more mailing lists