OSDN Git Service

aio: fix serial draining in exit_aio()
authorJens Axboe <axboe@fb.com>
Wed, 15 Apr 2015 17:17:23 +0000 (11:17 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jun 2015 00:03:20 +0000 (17:03 -0700)
commitb393b2aa50b3f85cab80fd11de00849917861b93
tree60b2ee8042d5a96a4b67c5e47fc20aec1c82bf12
parent2a98a9e619b560ad94240728042267eda81beeec
aio: fix serial draining in exit_aio()

commit dc48e56d761610da4ea1088d1bea0a030b8e3e43 upstream.

exit_aio() currently serializes killing io contexts. Each context
killing ends up having to do percpu_ref_kill(), which in turns has
to wait for an RCU grace period. This can take a long time, depending
on the number of contexts. And there's no point in doing them serially,
when we could be waiting for all of them in one fell swoop.

This patches makes my fio thread offload test case exit 0.2s instead
of almost 6s.

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/aio.c