| Date | Mon, 1 Apr 2013 22:36:09 -0400 | From | Theodore Ts'o <> | Subject | Re: [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
|