From: Linus Torvalds Date: Mon, 7 Nov 2011 03:02:23 +0000 (-0800) Subject: Merge branch 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git... X-Git-Tag: v3.2-rc1~23 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=208bca0860406d16398145ddd950036a737c3c9d Merge branch 'writeback-for-linus' of git://git./linux/kernel/git/wfg/linux * 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux: writeback: Add a 'reason' to wb_writeback_work writeback: send work item to queue_io, move_expired_inodes writeback: trace event balance_dirty_pages writeback: trace event bdi_dirty_ratelimit writeback: fix ppc compile warnings on do_div(long long, unsigned long) writeback: per-bdi background threshold writeback: dirty position control - bdi reserve area writeback: control dirty pause time writeback: limit max dirty pause time writeback: IO-less balance_dirty_pages() writeback: per task dirty rate limit writeback: stabilize bdi->dirty_ratelimit writeback: dirty rate control writeback: add bg_threshold parameter to __bdi_update_bandwidth() writeback: dirty position control writeback: account per-bdi accumulated dirtied pages --- 208bca0860406d16398145ddd950036a737c3c9d diff --cc mm/page-writeback.c index 793e9874de51,650846b61584..9c31199dae9a --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@@ -260,54 -250,8 +250,10 @@@ static void bdi_writeout_fraction(struc 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;