• Jens Axboe's avatar
    aio: fix serial draining in exit_aio() · 0b8b9770
    Jens Axboe authored
    commit dc48e56d 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: default avatarJeff Moyer <jmoyer@redhat.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
    0b8b9770
aio.c 40.3 KB