From: Christoph Hellwig <hch@lst.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Hellwig <hch@lst.de>,
viro@zeniv.linux.org.uk, Avi Kivity <avi@scylladb.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-aio@kvack.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] aio: allow direct aio poll comletions for keyed wakeups
Date: Wed, 8 Aug 2018 11:57:19 +0200 [thread overview]
Message-ID: <20180808095719.GA20653@lst.de> (raw)
In-Reply-To: <20180807090441.67f7e281f502ce448de849c1@linux-foundation.org>
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);
next prev parent reply other threads:[~2018-08-08 9:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-06 8:30 aio poll V22 (aka 2.0) Christoph Hellwig
2018-08-06 8:30 ` [PATCH 1/4] timerfd: add support for keyed wakeups Christoph Hellwig
2018-08-06 8:30 ` [PATCH 2/4] aio: add a iocb refcount Christoph Hellwig
2018-08-06 8:30 ` [PATCH 3/4] aio: implement IOCB_CMD_POLL Christoph Hellwig
2018-08-06 8:30 ` [PATCH 4/4] aio: allow direct aio poll comletions for keyed wakeups Christoph Hellwig
2018-08-06 22:27 ` Andrew Morton
2018-08-07 7:25 ` Christoph Hellwig
2018-08-07 16:04 ` Andrew Morton
2018-08-08 9:57 ` Christoph Hellwig [this message]
2018-08-07 11:44 ` [PATCH 4/4 v2] " Christoph Hellwig
2018-08-06 16:49 ` aio poll V22 (aka 2.0) Linus Torvalds
2018-08-07 7:27 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2018-07-30 7:15 aio poll and a new in-kernel poll API V21 " Christoph Hellwig
2018-07-30 7:15 ` [PATCH 4/4] aio: allow direct aio poll comletions for keyed wakeups Christoph Hellwig
2018-07-26 8:28 aio poll and a new in-kernel poll API V20 (aka 2.0) Christoph Hellwig
2018-07-26 8:29 ` [PATCH 4/4] aio: allow direct aio poll comletions for keyed wakeups Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180808095719.GA20653@lst.de \
--to=hch@lst.de \
--cc=akpm@linux-foundation.org \
--cc=avi@scylladb.com \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.