diff options
author | Tejun Heo <tj@kernel.org> | 2015-05-22 17:13:46 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-06-02 08:33:35 -0600 |
commit | 766a9d6e60578f1ef6de71f89f022084f8bffc82 (patch) | |
tree | c14261a70cdc790ffca5e82fa006fa8adf663319 /include | |
parent | d6c10f1fc8626dc55946f4768ae322b4c57b07dd (diff) | |
download | linux-stable-766a9d6e60578f1ef6de71f89f022084f8bffc82.tar.gz linux-stable-766a9d6e60578f1ef6de71f89f022084f8bffc82.tar.bz2 linux-stable-766a9d6e60578f1ef6de71f89f022084f8bffc82.zip |
writeback: implement backing_dev_info->tot_write_bandwidth
cgroup writeback support needs to keep track of the sum of
avg_write_bandwidth of all wb's (bdi_writeback's) with dirty inodes to
distribute write workload. This patch adds bdi->tot_write_bandwidth
and updates inode_wb_list_move_locked(), inode_wb_list_del_locked()
and wb_update_write_bandwidth() to adjust it as wb's gain and lose
dirty inodes and its avg_write_bandwidth gets updated.
As the update events are not synchronized with each other,
bdi->tot_write_bandwidth is an atomic_long_t.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/backing-dev-defs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h index 7a94b7850b7c..d631a61f4023 100644 --- a/include/linux/backing-dev-defs.h +++ b/include/linux/backing-dev-defs.h @@ -142,6 +142,8 @@ struct backing_dev_info { unsigned int min_ratio; unsigned int max_ratio, max_prop_frac; + atomic_long_t tot_write_bandwidth; /* sum of active avg_write_bw */ + struct bdi_writeback wb; /* the root writeback info for this bdi */ struct bdi_writeback_congested wb_congested; /* its congested state */ #ifdef CONFIG_CGROUP_WRITEBACK |