summaryrefslogtreecommitdiffstats
path: root/include/linux/writeback.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-05-22 18:23:20 -0400
committerJens Axboe <axboe@fb.com>2015-06-02 10:38:12 -0400
commit8a73179956e649df0d4b3250db17734f272d8266 (patch)
tree941373ecb8e170f874c6343ba35877b337f33443 /include/linux/writeback.h
parent0d960a383ae7aa791b2833e122ba7519d264cf92 (diff)
writeback: reorganize [__]wb_update_bandwidth()
__wb_update_bandwidth() is called from two places - fs/fs-writeback.c::balance_dirty_pages() and mm/page-writeback.c::wb_writeback(). The latter updates only the write bandwidth while the former also deals with the dirty ratelimit. The two callsites are distinguished by whether @thresh parameter is zero or not, which is cryptic. In addition, the two files define their own different versions of wb_update_bandwidth() on top of __wb_update_bandwidth(), which is confusing to say the least. This patch cleans up [__]wb_update_bandwidth() in the following ways. * __wb_update_bandwidth() now takes explicit @update_ratelimit parameter to gate dirty ratelimit handling. * mm/page-writeback.c::wb_update_bandwidth() is flattened into its caller - balance_dirty_pages(). * fs/fs-writeback.c::wb_update_bandwidth() is moved to mm/page-writeback.c and __wb_update_bandwidth() is made static. * While at it, add a lockdep assertion to __wb_update_bandwidth(). Except for the lockdep addition, this is pure reorganization and doesn't introduce any behavioral changes. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Jens Axboe <axboe@kernel.dk> Cc: Jan Kara <jack@suse.cz> Cc: Wu Fengguang <fengguang.wu@intel.com> Cc: Greg Thelen <gthelen@google.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/writeback.h')
-rw-r--r--include/linux/writeback.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 0435c85d4cfa..80adf3d88d9d 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -157,14 +157,7 @@ int dirty_writeback_centisecs_handler(struct ctl_table *, int,
157void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty); 157void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);
158unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh); 158unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh);
159 159
160void __wb_update_bandwidth(struct bdi_writeback *wb, 160void wb_update_bandwidth(struct bdi_writeback *wb, unsigned long start_time);
161 unsigned long thresh,
162 unsigned long bg_thresh,
163 unsigned long dirty,
164 unsigned long bdi_thresh,
165 unsigned long bdi_dirty,
166 unsigned long start_time);
167
168void page_writeback_init(void); 161void page_writeback_init(void);
169void balance_dirty_pages_ratelimited(struct address_space *mapping); 162void balance_dirty_pages_ratelimited(struct address_space *mapping);
170 163