• Y
    blk-mq: allow hardware queue to get more tag while sharing a tag set · c6f9c0e2
    Yu Kuai 提交于
    hulk inclusion
    category: performance
    bugzilla: https://gitee.com/openeuler/kernel/issues/I4S8DW
    
    ---------------------------
    
    When sharing a tag set, if most disks are issuing small amount of IO, and
    only a few is issuing a large amount of IO. Current approach is to limit
    the max amount of tags a disk can get equally to the average of total
    tags. Thus the few heavy load disk can't get enough tags while many tags
    are still free in the tag set.
    
    We add 'pending_queues' in blk_mq_tag_set to count how many queues can't
    get driver tag. Thus if this value is zero, there is no need to limit
    the max number of available tags.
    
    On the other hand, if a queue doesn't issue IO, the 'active_queues' will
    not be decreased in a period of time(request timeout), thus a lot of tags
    will not be available because max number of available tags is set to
    max(total tags / active_queues, 4). Thus we decreased it when
    'nr_active' is 0.
    
    This functionality is enabled by default, to disable it, add
    "blk_mq.unfair_dtag=0" to boot cmd.
    Signed-off-by: NYu Kuai <yukuai3@huawei.com>
    Reviewed-by: NHou Tao <houtao1@huawei.com>
    Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
    c6f9c0e2
blk-mq-tag.c 18.8 KB