numerator, denominator);
}
- static inline void task_dirties_fraction(struct task_struct *tsk,
- long *numerator, long *denominator)
- {
- prop_fraction_single(&vm_dirties, &tsk->dirties,
- numerator, denominator);
- }
-
- /*
- * task_dirty_limit - scale down dirty throttling threshold for one task
- *
- * task specific dirty limit:
- *
- * dirty -= (dirty/8) * p_{t}
- *
- * To protect light/slow dirtying tasks from heavier/fast ones, we start
- * throttling individual tasks before reaching the bdi dirty limit.
- * Relatively low thresholds will be allocated to heavy dirtiers. So when
- * dirty pages grow large, heavy dirtiers will be throttled first, which will
- * effectively curb the growth of dirty pages. Light dirtiers with high enough
- * dirty threshold may never get throttled.
- */
- #define TASK_LIMIT_FRACTION 8
- static unsigned long task_dirty_limit(struct task_struct *tsk,
- unsigned long bdi_dirty)
- {
- long numerator, denominator;
- unsigned long dirty = bdi_dirty;
- u64 inv = dirty / TASK_LIMIT_FRACTION;
-
- task_dirties_fraction(tsk, &numerator, &denominator);
- inv *= numerator;
- do_div(inv, denominator);
-
- dirty -= inv;
-
- return max(dirty, bdi_dirty/2);
- }
-
- /* Minimum limit for any task */
- static unsigned long task_min_dirty_limit(unsigned long bdi_dirty)
- {
- return bdi_dirty - bdi_dirty / TASK_LIMIT_FRACTION;
- }
-
/*
- *
+ * bdi_min_ratio keeps the sum of the minimum dirty shares of all
+ * registered backing devices, which, for obvious reasons, can not
+ * exceed 100%.
*/
static unsigned int bdi_min_ratio;