Skip to content
  • Tejun Heo's avatar
    blk-throttle: make tg_dispatch_one_bio() ready for hierarchy · 6bc9c2b4
    Tejun Heo authored
    
    
    tg_dispatch_one_bio() currently assumes that the parent_sq is the top
    level one and the bio being dispatched is ready to be issued; however,
    this assumption will be wrong with proper hierarchy support.  This
    patch makes the following changes to make tg_dispatch_on_bio() ready
    for hiearchy.
    
    * throtl_data->nr_queued[] is incremented in blk_throtl_bio() instead
      of throtl_add_bio_tg() so that throtl_add_bio_tg() can be used to
      transfer a bio from a child tg to its parent.
    
    * tg_dispatch_one_bio() is updated to distinguish whether its parent
      is another throtl_grp or the throtl_data.  If former, the bio is
      transferred to the parent throtl_grp using throtl_add_bio_tg().  If
      latter, the bio is ready to be issued and put on the top-level
      service_queue's bio_lists[] and throtl_data->nr_queued is
      decremented.
    
    As all throtl_grps currently have the top level service_queue as their
    ->parent_sq, this patch in itself doesn't make any behavior
    difference.
    
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Acked-by: default avatarVivek Goyal <vgoyal@redhat.com>
    6bc9c2b4