• Arianna Avanzini's avatar
    block, bfq: handle bursts of queue activations · e1b2324d
    Arianna Avanzini authored
    Many popular I/O-intensive services or applications spawn or
    reactivate many parallel threads/processes during short time
    intervals. Examples are systemd during boot or git grep.  These
    services or applications benefit mostly from a high throughput: the
    quicker the I/O generated by their processes is cumulatively served,
    the sooner the target job of these services or applications gets
    completed. As a consequence, it is almost always counterproductive to
    weight-raise any of the queues associated to the processes of these
    services or applications: in most cases it would just lower the
    throughput, mainly because weight-raising also implies device idling.
    
    To address this issue, an I/O scheduler needs, first, to detect which
    queues are associated with these services or applications. In this
    respect, we have that, from the I/O-scheduler standpoint, these
    services or applications cause bursts of activations, i.e.,
    activations of different queues occurring shortly after each
    other. However, a shorter burst of activations may be caused also by
    the start of an application that does not consist in a lot of parallel
    I/O-bound threads (see the comments on the function bfq_handle_burst
    for details).
    
    In view of these facts, this commit introduces:
    1) an heuristic to detect (only) bursts of queue activations caused by
       services or applications consisting in many parallel I/O-bound
       threads;
    2) the prevention of device idling and weight-raising for the queues
       belonging to these bursts.
    Signed-off-by: default avatarArianna Avanzini <avanzini.arianna@gmail.com>
    Signed-off-by: default avatarPaolo Valente <paolo.valente@linaro.org>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    e1b2324d
bfq-iosched.c 269 KB