Skip to content
  • Paolo Valente's avatar
    block, bfq: fix decrement of num_active_groups · ba7aeae5
    Paolo Valente authored
    Since commit '2d29c9f8 ("block, bfq: improve asymmetric scenarios
    detection")', if there are process groups with I/O requests waiting for
    completion, then BFQ tags the scenario as 'asymmetric'. This detection
    is needed for preserving service guarantees (for details, see comments
    on the computation * of the variable asymmetric_scenario in the
    function bfq_better_to_idle).
    
    Unfortunately, commit '2d29c9f8 ("block, bfq: improve asymmetric
    scenarios detection")' contains an error exactly in the updating of
    the number of groups with I/O requests waiting for completion: if a
    group has more than one descendant process, then the above number of
    groups, which is renamed from num_active_groups to a more appropriate
    num_groups_with_pending_reqs by this commit, may happen to be wrongly
    decremented multiple times, namely every time one of the descendant
    processes gets all its pending I/O requests completed.
    
    A correct, complete solution should work as follows. Con...
    ba7aeae5