]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "blk-throttle: fix race between blkcg_bio_issue_check() and cgroup_rmdir()"
authorDennis Zhou (Facebook) <dennisszhou@gmail.com>
Fri, 31 Aug 2018 20:22:42 +0000 (16:22 -0400)
committerJens Axboe <axboe@kernel.dk>
Fri, 31 Aug 2018 20:48:54 +0000 (14:48 -0600)
commit6d5c1294e6981a052ad0acabfe55c223a11a9efe
tree4ee94bc8c5ba5ac96a1260ab9efc6c67b4a344a9
parent147a8c46fb48b5bed6a5546c505f2a1e61dd6743
Revert "blk-throttle: fix race between blkcg_bio_issue_check() and cgroup_rmdir()"

This reverts commit a03a9cd377e2d221dffa48df4aaf7d7d900d5c30.

Destroying blkgs is tricky because of the nature of the relationship. A
blkg should go away when either a blkcg or a request_queue goes away.
However, blkg's pin the blkcg to ensure they remain valid. To break this
cycle, when a blkcg is offlined, blkgs put back their css ref. This
eventually lets css_free() get called which frees the blkcg.

The above commit (a03a9cd377e2) breaks this order of events by trying to
destroy blkgs in css_free(). As the blkgs still hold references to the
blkcg, css_free() is never called.

The race between blkcg_bio_issue_check() and cgroup_rmdir() will be
addressed in the following patch by delaying destruction of a blkg until
all writeback associated with the blkcg has been finished.

Fixes: a03a9cd377e2 ("blk-throttle: fix race between blkcg_bio_issue_check() and cgroup_rmdir()")
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Dennis Zhou <dennisszhou@gmail.com>
Cc: Jiufei Xue <jiufei.xue@linux.alibaba.com>
Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-cgroup.c
include/linux/blk-cgroup.h