mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Jan Kara <[email protected]> Cc: Wu Fengguang <[email protected]> Cc: Greg Thelen <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
9fc3a43e17
commit
aa661bbe1e
3 changed files with 26 additions and 18 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue