Commit 9dcfca65 authored by Zhang Wensheng's avatar Zhang Wensheng Committed by Yongqiang Liu
Browse files

block: use "precise_iostat" to switch accurate iostat account

hulk inclusion
category: bugfix
bugzilla: 187044, https://gitee.com/openeuler/kernel/issues/I5F2BY


CVE: NA

--------------------------------

There is io path like:
blk_mq_make_request
 blk_mq_bio_to_request
  blk_account_io_start
   part_round_stats
    part_in_flight
     /* controlled by precise_iostat, it also can calculated
	by atomic accumulation
      */
     blk_mq_in_flight
      blk_mq_queue_tag_busy_iter
       bt_for_each
        blk_mq_find_and_get_req
         blk_mq_tags_lock_irqsave
         ...
         blk_mq_tags_unlock_irqrestore
As we can see, there is a unnecessary locking operation in io path
which will affect concurrency performance. This problem was introduced
by "part_round_stats" and "part_in_flight" which using tag to account
inflight.

Fix it by using "precise_iostat" too, moving part_round_stats into
"precise_iostat", when "precise_iostat" is on, the iostat is accurate
and using atomic accumulation to account inflight. when it is off,
the io iostat will not be accurate.

Signed-off-by: default avatarZhang Wensheng <zhangwensheng5@huawei.com>
Reviewed-by: default avatarYu Kuai <yukuai3@huawei.com>
Reviewed-by: default avatarJason Yan <yanaijie@huawei.com>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 09614b96
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment