diff options
author | Tejun Heo <tj@kernel.org> | 2013-05-14 22:52:32 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-05-14 22:52:32 +0200 |
commit | 6a525600ffeb9e0d6cbbebda49eb89d6d3408c2b (patch) | |
tree | f4ced3b39162c54ecf12f0171b781e60d54e4a7c /lib/dec_and_lock.c | |
parent | blk-throttle: relocate throtl_schedule_delayed_work() (diff) | |
download | linux-6a525600ffeb9e0d6cbbebda49eb89d6d3408c2b.tar.xz linux-6a525600ffeb9e0d6cbbebda49eb89d6d3408c2b.zip |
blk-throttle: remove pointless throtl_nr_queued() optimizations
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: Tejun Heo <tj@kernel.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Diffstat (limited to 'lib/dec_and_lock.c')
0 files changed, 0 insertions, 0 deletions