Skip to content
  • Tejun Heo's avatar
    writeback: memcg dirty_throttle_control should be initialized with wb->memcg_completions · d60d1bdd
    Tejun Heo authored
    
    
    MDTC_INIT() is used to initialize dirty_throttle_control for memcg
    domains.  It used DTC_INIT_COMMON() to initialized mdtc->wb and
    ->wb_completions which is incorrect as DTC_INIT_COMMON() sets the
    latter to wb->completions instead of wb->memcg_completions.  This can
    lead to wildly incorrect results when calculating the proportion of
    dirty memory the memcg domain should get.
    
    Remove DTC_INIT_COMMON() and update MDTC_INIT() to initialize
    mdtc->wb_completions to wb->memcg_completions.
    
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Fixes: c2aa723a
    
     ("writeback: implement memcg writeback domain based throttling")
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    d60d1bdd