aio: improve locking
authorJens Axboe <axboe@kernel.dk>
Fri, 14 Dec 2012 10:45:37 +0000 (11:45 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 14 Dec 2012 12:28:10 +0000 (13:28 +0100)
commit0c4061cf58a7adddb613428b9dd0f6c8f2de89bd
treeffdfcc788c6f61064c78121ee84c668c564a85df
parentd3bb31cf59bcd3b79a163b2cc6d823fcf1d7c5b5
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