• T
    blk-throttle: remove pointless throtl_nr_queued() optimizations · 6a525600
    Tejun Heo 提交于
    throtl_nr_queued() is used in several places to avoid performing
    certain operations when the throtl_data is empty.  This usually is
    useless as those paths usually aren't traveled if there's no bio
    queued.
    
    * throtl_schedule_delayed_work() skips scheduling dispatch work item
      if @td doesn't have any bios queued; however, the only case it can
      be called when @td is empty is from tg_set_conf() which isn't
      something we should be optimizing for.
    
    * throtl_schedule_next_dispatch() takes a quick exit if @td is empty;
      however, right after that it triggers BUG if the service tree is
      empty.  The two conditions are equivalent and it can just test
      @st->count for the quick exit.
    
    * blk_throtl_dispatch_work_fn() skips dispatch if @td is empty.  This
      work function isn't usually invoked when @td is empty.  The only
      possibility is from tg_set_conf() and when it happens the normal
      dispatching path can handle empty @td fine.  No need to add special
      skip path.
    
    This patch removes the above three unnecessary optimizations, which
    leave throtl_log() call in blk_throtl_dispatch_work_fn() the only user
    of throtl_nr_queued().  Remove throtl_nr_queued() and open code it in
    throtl_log().  I don't think we need td->nr_queued[] at all.  Maybe we
    can remove it later.
    Signed-off-by: NTejun Heo <tj@kernel.org>
    Acked-by: NVivek Goyal <vgoyal@redhat.com>
    6a525600
blk-throttle.c 29.6 KB