linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Christoph Hellwig <hch@lst.de>
Cc: 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: Tue, 7 Aug 2018 09:04:41 -0700	[thread overview]
Message-ID: <20180807090441.67f7e281f502ce448de849c1@linux-foundation.org> (raw)
In-Reply-To: <20180807072555.GA678@lst.de>

On Tue, 7 Aug 2018 09:25:55 +0200 Christoph Hellwig <hch@lst.de> wrote:

> On Mon, Aug 06, 2018 at 03:27:05PM -0700, Andrew Morton wrote:
> > On Mon,  6 Aug 2018 10:30:58 +0200 Christoph Hellwig <hch@lst.de> wrote:
> > 
> > > If we get a keyed wakeup for a aio poll waitqueue and wake can acquire the
> > > ctx_lock without spinning we can just complete the iocb straight from the
> > > wakeup callback to avoid a context switch.
> > 
> > Why do we try to avoid spinning on the lock?
> 
> Because we are called with the lock on the waitqueue called, which
> nests inside it.

Ah.

> > > +		/* try to complete the iocb inline if we can: */
> > 
> > ie, this comment explains 'what" but not "why".
> > 
> > (There's a typo in Subject:, btw)
> 
> 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().

  reply	other threads:[~2018-08-07 18:19 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 [this message]
2018-08-08  9:57         ` Christoph Hellwig
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=20180807090441.67f7e281f502ce448de849c1@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=avi@scylladb.com \
    --cc=hch@lst.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).