• Paolo Valente's avatar
    block, bfq: improve throughput boosting · 54b60456
    Paolo Valente authored
    The feedback-loop algorithm used by BFQ to compute queue (process)
    budgets is basically a set of three update rules, one for each of the
    main reasons why a queue may be expired. If many processes suddenly
    switch from sporadic I/O to greedy and sequential I/O, then these
    rules are quite slow to assign large budgets to these processes, and
    hence to achieve a high throughput. On the opposite side, BFQ assigns
    the maximum possible budget B_max to a just-created queue. This allows
    a high throughput to be achieved immediately if the associated process
    is I/O-bound and performs sequential I/O from the beginning. But it
    also increases the worst-case latency experienced by the first
    requests issued by the process, because the larger the budget of a
    queue waiting for service is, the later the queue will be served by
    B-WF2Q+ (Subsec 3.3 in [1]). This is detrimental for an interactive or
    soft real-time application.
    
    To tackle these throughput and latency problems, on one hand this
    patch changes the initial budget value to B_max/2. On the other hand,
    it re-tunes the three rules, adopting a more aggressive,
    multiplicative increase/linear decrease scheme. This scheme trades
    latency for throughput more than before, and tends to assign large
    budgets quickly to processes that are or become I/O-bound. For two of
    the expiration reasons, the new version of the rules also contains
    some more little improvements, briefly described below.
    
    *No more backlog.* In this case, the budget was larger than the number
    of sectors actually read/written by the process before it stopped
    doing I/O. Hence, to reduce latency for the possible future I/O
    requests of the process, the old rule simply set the next budget to
    the number of sectors actually consumed by the process. However, if
    there are still outstanding requests, then the process may have not
    yet issued its next request just because it is still waiting for the
    completion of some of the still outstanding ones. If this sub-case
    holds true, then the new rule, instead of decreasing the budget,
    doubles it, proactively, in the hope that: 1) a larger budget will fit
    the actual needs of the process, and 2) the process is sequential and
    hence a higher throughput will be achieved by serving the process
    longer after granting it access to the device.
    
    *Budget timeout*. The original rule set the new budget to the maximum
    value B_max, to maximize throughput and let all processes experiencing
    budget timeouts receive the same share of the device time. In our
    experiments we verified that this sudden jump to B_max did not provide
    sensible benefits; rather it increased the latency of processes
    performing sporadic and short I/O. The new rule only doubles the
    budget.
    
    [1] P. Valente and M. Andreolini, "Improving Application
        Responsiveness with the BFQ Disk I/O Scheduler", Proceedings of
        the 5th Annual International Systems and Storage Conference
        (SYSTOR '12), June 2012.
        Slightly extended version:
        http://algogroup.unimore.it/people/paolo/disk_sched/bfq-v1-suite-
    							results.pdf
    Signed-off-by: default avatarPaolo Valente <paolo.valente@linaro.org>
    Signed-off-by: default avatarArianna Avanzini <avanzini.arianna@gmail.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    54b60456
bfq-iosched.c 173 KB