lkml.org 
[lkml]   [2013]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 16/33] aio: use cancellation list lazily
On Thu, Mar 21, 2013 at 09:35:37AM -0700, Kent Overstreet wrote:
> Cancelling kiocbs requires adding them to a per kioctx linked list, which
> is one of the few things we need to take the kioctx lock for in the fast
> path. But most kiocbs can't be cancelled - so if we just do this lazily,
> we can avoid quite a bit of locking overhead.
>
> While we're at it, instead of using a flag bit switch to using ki_cancel
> itself to indicate that a kiocb has been cancelled/completed. This lets
> us get rid of ki_flags entirely.


Reviewed-by: "Theodore Ts'o" <tytso@mit.edu>

One nit....

> + * And since most things don't implement kiocb cancellation and we'd really like
> + * kiocb completion to be lockless when possible, we use ki_cancel to
> + * synchronize cancellation and completion - we only set it to KIOCB_CANCELLED
> + * with xchg() or cmpxchg(), see batch_complete_aio() and kiocb_cancel().

It's not batch_complete_aio() until later in the patch series.... as
of this commit, it's still aio_complete()

- Ted


\
 
 \ /
  Last update: 2013-04-02 05:01    [W:0.449 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site