• Tejun Heo's avatar
    writeback: consolidate dirty throttle parameters into dirty_throttle_control · 2bc00aef
    Tejun Heo authored
    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: default avatarTejun 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: default avatarJens Axboe <axboe@fb.com>
    2bc00aef
page-writeback.c 75.8 KB