diff options
author | Tejun Heo <tj@kernel.org> | 2015-07-02 08:44:34 -0600 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-07-02 08:46:00 -0600 |
commit | a13f35e8714009145e32ebe2bf25b84e1376e314 (patch) | |
tree | 911f2bddedea196ec012c4aaa9c17d35b4e36acc /lib | |
parent | 4da3064d1775810f10f7ddc1c34c3f1ff502a654 (diff) | |
download | op-kernel-dev-a13f35e8714009145e32ebe2bf25b84e1376e314.zip op-kernel-dev-a13f35e8714009145e32ebe2bf25b84e1376e314.tar.gz |
writeback: don't embed root bdi_writeback_congested in bdi_writeback
52ebea749aae ("writeback: make backing_dev_info host cgroup-specific
bdi_writebacks") made bdi (backing_dev_info) host per-cgroup wb's
(bdi_writeback's). As the congested state needs to be per-wb and
referenced from blkcg side and multiple wbs, the patch made all
non-root cong's (bdi_writeback_congested's) reference counted and
indexed on bdi.
When a bdi is destroyed, cgwb_bdi_destroy() tries to drain all
non-root cong's; however, this can hang indefinitely because wb's can
also be referenced from blkcg_gq's which are destroyed after bdi
destruction is complete.
To fix the bug, bdi destruction will be updated to not wait for cong's
to drain, which naturally means that cong's may outlive the associated
bdi. This is fine for non-root cong's but is problematic for the root
cong's which are embedded in their bdi's as they may end up getting
dereferenced after the containing bdi's are freed.
This patch makes root cong's behave the same as non-root cong's. They
are no longer embedded in their bdi's but allocated separately during
bdi initialization, indexed and reference counted the same way.
* As cong handling is the same for all wb's, wb->congested
initialization is moved into wb_init().
* When !CONFIG_CGROUP_WRITEBACK, there was no indexing or refcnting.
bdi->wb_congested is now a pointer pointing to the root cong
allocated during bdi init and minimal refcnting operations are
implemented.
* The above makes root wb init paths diverge depending on
CONFIG_CGROUP_WRITEBACK. root wb init is moved to cgwb_bdi_init().
This patch in itself shouldn't cause any consequential behavior
differences but prepares for the actual fix.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Jon Christopherson <jon@jons.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=100681
Tested-by: Jon Christopherson <jon@jons.org>
Added <linux/slab.h> include to backing-dev.h for kfree() definition.
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions