lkml.org 
[lkml]   [2020]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 7/7] blk-iocost: Factor out the base vrate change into a separate function
Hello,

On Tue, Nov 24, 2020 at 11:33:36AM +0800, Baolin Wang wrote:
> @@ -2320,45 +2358,11 @@ static void ioc_timer_fn(struct timer_list *timer)
> ioc->busy_level = clamp(ioc->busy_level, -1000, 1000);
>
> if (ioc->busy_level > 0 || (ioc->busy_level < 0 && !nr_lagging)) {
> - u64 vrate = ioc->vtime_base_rate;
> - u64 vrate_min = ioc->vrate_min, vrate_max = ioc->vrate_max;
...
> + trace_iocost_ioc_vrate_adj(ioc, ioc->vtime_base_rate,
> + missed_ppm, rq_wait_pct,
> nr_lagging, nr_shortages);
> -
> - ioc->vtime_base_rate = vrate;
> - ioc_refresh_margins(ioc);
> } else if (ioc->busy_level != prev_busy_level || nr_lagging) {
> trace_iocost_ioc_vrate_adj(ioc, atomic64_read(&ioc->vtime_rate),
> missed_ppm, rq_wait_pct, nr_lagging,

I think it'd be better to factor out the surrounding if/else block together
(as early exit if blocks). Also, how about ioc_adjust_base_vrate()?

Thanks.

--
tejun

\
 
 \ /
  Last update: 2020-11-25 13:31    [W:0.105 / U:25.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site