aio: improve locking
authorJens Axboe <axboe@kernel.dk>
Fri, 14 Dec 2012 10:45:37 +0000 (11:45 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 22 Apr 2013 01:29:58 +0000 (19:29 -0600)
commit75bfd166676d13faaf3c18164942aec5881ae4b2
tree953a16169888f29cf4a06367404b57cb946277a5
parenta57423b03e2ee348970233e366c9af30d29650e3
aio: improve locking

Currently we use the ctx->ctx_lock to protect:

- ->ki_list, items on the cancel list
- ->reqs_active, number of items active on the cancel list
- ->ki_users, number of references to the kiocb
- aio ring code

With the aio cancel and user ring now optional, we don't have to grab
the lock unless we are USB gadget code or somebody has requested that
the ring be active. Make the ->reqs_active and ->ki_users atomic types,
so we can completely avoid it for most cases.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/aio.c
include/linux/aio.h