writeback: consolidate dirty throttle parameters into dirty_throttle_control
authorTejun Heo <tj@kernel.org>
Fri, 22 May 2015 22:23:23 +0000 (18:23 -0400)
committerJens Axboe <axboe@fb.com>
Tue, 2 Jun 2015 14:38:12 +0000 (08:38 -0600)
commit2bc00aef030f4f75550d5c88062ce1830e40097f
tree1a75b5cce84ff129644dff6d35c1fe0fe33471a1
parentdcc25ae76eb7b8ff883eaaab57e30e8f2f085be3
writeback: consolidate dirty throttle parameters into dirty_throttle_control

Dirty throttling implemented in balance_dirty_pages() and its
subroutines makes use of a number of parameters which are passed
around individually.  This renders these functions somewhat unwieldy
and makes it difficult to add or change the involved parameters.  Also
some functions use different or conflicting naming schemes for the
same parameters making the code confusing to follow.

This patch consolidates the main parameters into struct
dirty_throttle_control so that they can be passed around easily and
adding new paramters isn't painful.  This also unifies how a given
parameter is named and accessed.  The drawback of using this type of
control structure rather than explicit paramters is that it isn't
immediately obvious which function accesses and modifies what;
however, it's fairly clear that the benefits outweigh in this case.

GDTC_INIT() macro is provided to ease initializing
dirty_throttle_control for the global_wb_domain and
balance_dirty_pages() uses a separate pointer to point to its global
dirty_throttle_control.  This is to make it uniform with memcg domain
handling which will be added later.

This patch 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>
mm/page-writeback.c