writeback: move over_bground_thresh() to mm/page-writeback.c
and rename it to wb_over_bg_thresh(). The function is closely tied to the dirty throttling mechanism implemented in page-writeback.c. This relocation will allow future updates necessary for cgroup writeback support. While at it, add function comment. 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>
This commit is contained in:
@@ -1740,6 +1740,29 @@ void balance_dirty_pages_ratelimited(struct address_space *mapping)
|
||||
}
|
||||
EXPORT_SYMBOL(balance_dirty_pages_ratelimited);
|
||||
|
||||
/**
|
||||
* wb_over_bg_thresh - does @wb need to be written back?
|
||||
* @wb: bdi_writeback of interest
|
||||
*
|
||||
* Determines whether background writeback should keep writing @wb or it's
|
||||
* clean enough. Returns %true if writeback should continue.
|
||||
*/
|
||||
bool wb_over_bg_thresh(struct bdi_writeback *wb)
|
||||
{
|
||||
unsigned long background_thresh, dirty_thresh;
|
||||
|
||||
global_dirty_limits(&background_thresh, &dirty_thresh);
|
||||
|
||||
if (global_page_state(NR_FILE_DIRTY) +
|
||||
global_page_state(NR_UNSTABLE_NFS) > background_thresh)
|
||||
return true;
|
||||
|
||||
if (wb_stat(wb, WB_RECLAIMABLE) > wb_calc_thresh(wb, background_thresh))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void throttle_vm_writeout(gfp_t gfp_mask)
|
||||
{
|
||||
unsigned long background_thresh;
|
||||
|
Reference in New Issue
Block a user