]> git.baikalelectronics.ru Git - kernel.git/commit
block: an exiting task should be allowed to create io_context
authorTejun Heo <tj@kernel.org>
Sun, 25 Dec 2011 13:29:14 +0000 (14:29 +0100)
committerJens Axboe <axboe@kernel.dk>
Sun, 25 Dec 2011 13:29:14 +0000 (14:29 +0100)
commita2d58bf9222ed008c5b551a5b8c5b55448cef55e
tree9262ccdc0319b331c497701a851c8c5752dedb00
parentd853d9cb746ce0a15f3dab4ad96e77546d4dead2
block: an exiting task should be allowed to create io_context

While fixing io_context creation / task exit race condition,
44df6b2b27 "block: make ioc get/put interface more conventional and
fix race on alloction" also prevented an exiting (%PF_EXITING) task
from creating its own io_context.  This is incorrect as exit path may
issue IOs, e.g. from exit_files(), and if those IOs are the first ones
issued by the task, io_context needs to be created to process the IOs.

Combined with the existing problem of io_context / io_cq creation
failure having the possibility of stalling IO, this problem results in
deterministic full IO lockup with certain workloads.

Fix it by allowing io_context creation regardless of %PF_EXITING for
%current.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-ioc.c