]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - block/blk-throttle.c
blk-throttle: make blk_throtl_bio() ready for hierarchy
authorTejun Heo <tj@kernel.org>
Tue, 14 May 2013 20:52:38 +0000 (13:52 -0700)
committerTejun Heo <tj@kernel.org>
Tue, 14 May 2013 20:52:38 +0000 (13:52 -0700)
commit9e660acffcd1b5adc4ec1ffba0cbb584f86b8907
tree96ac75e374c9a7069e07093a1c636aebf76d8a3d
parent2a12f0dcdad1ba7c0e53bbff8e5f6d0ee7a29882
blk-throttle: make blk_throtl_bio() ready for hierarchy

Currently, blk_throtl_bio() issues the passed in bio directly if it's
within limits of its associated tg (throtl_grp).  This behavior
becomes incorrect with hierarchy support as the bio should be
accounted to and throttled by the ancestor throtl_grps too.

This patch makes the direct issue path of blk_throtl_bio() to loop
until it reaches the top-level service_queue or gets throttled.  If
the former, the bio can be issued directly; otherwise, it gets queued
at the first layer it was above limits.

As tg->parent_sq is always the top-level service queue currently, this
patch in itself doesn't make any behavior differences.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
block/blk-throttle.c