aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/writeback.h
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2011-03-02 16:54:09 -0500
committerWu Fengguang <fengguang.wu@intel.com>2011-07-10 01:09:02 -0400
commitc42843f2f0bbc9d716a32caf667d18fc2bf3bc4c (patch)
tree835b801d215dd70cbb5a282232ce23fa3167a880 /include/linux/writeback.h
parent7762741e3af69720186802e945229b6a5afd5c49 (diff)
writeback: introduce smoothed global dirty limit
The start of a heavy weight application (ie. KVM) may instantly knock down determine_dirtyable_memory() if the swap is not enabled or full. global_dirty_limits() and bdi_dirty_limit() will in turn get global/bdi dirty thresholds that are _much_ lower than the global/bdi dirty pages. balance_dirty_pages() will then heavily throttle all dirtiers including the light ones, until the dirty pages drop below the new dirty thresholds. During this _deep_ dirty-exceeded state, the system may appear rather unresponsive to the users. About "deep" dirty-exceeded: task_dirty_limit() assigns 1/8 lower dirty threshold to heavy dirtiers than light ones, and the dirty pages will be throttled around the heavy dirtiers' dirty threshold and reasonably below the light dirtiers' dirty threshold. In this state, only the heavy dirtiers will be throttled and the dirty pages are carefully controlled to not exceed the light dirtiers' dirty threshold. However if the threshold itself suddenly drops below the number of dirty pages, the light dirtiers will get heavily throttled. So introduce global_dirty_limit for tracking the global dirty threshold with policies - follow downwards slowly - follow up in one shot global_dirty_limit can effectively mask out the impact of sudden drop of dirtyable memory. It will be used in the next patch for two new type of dirty limits. Note that the new dirty limits are not going to avoid throttling the light dirtiers, but could limit their sleep time to 200ms. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Diffstat (limited to 'include/linux/writeback.h')
-rw-r--r--include/linux/writeback.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 66862f2d90c8..e9d371b6053b 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -84,6 +84,8 @@ static inline void laptop_sync_completion(void) { }
84#endif 84#endif
85void throttle_vm_writeout(gfp_t gfp_mask); 85void throttle_vm_writeout(gfp_t gfp_mask);
86 86
87extern unsigned long global_dirty_limit;
88
87/* These are exported to sysctl. */ 89/* These are exported to sysctl. */
88extern int dirty_background_ratio; 90extern int dirty_background_ratio;
89extern unsigned long dirty_background_bytes; 91extern unsigned long dirty_background_bytes;
@@ -119,6 +121,10 @@ unsigned long bdi_dirty_limit(struct backing_dev_info *bdi,
119 unsigned long dirty); 121 unsigned long dirty);
120 122
121void __bdi_update_bandwidth(struct backing_dev_info *bdi, 123void __bdi_update_bandwidth(struct backing_dev_info *bdi,
124 unsigned long thresh,
125 unsigned long dirty,
126 unsigned long bdi_thresh,
127 unsigned long bdi_dirty,
122 unsigned long start_time); 128 unsigned long start_time);
123 129
124void page_writeback_init(void); 130void page_writeback_init(void);