From: Ming Lei <ming.lei@redhat.com>
To: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
Mike Snitzer <snitzer@redhat.com>,
mpatocka@redhat.com
Subject: [regression] very inaccurate %util of iostat
Date: Tue, 24 Mar 2020 11:19:42 +0800 [thread overview]
Message-ID: <20200324031942.GA3060@ming.t460p> (raw)
Hi Guys,
Commit 5b18b5a73760 ("block: delete part_round_stats and switch to less precise counting")
changes calculation of 'io_ticks' a lot.
In theory, io_ticks counts the time when there is any IO in-flight or in-queue,
so it has to rely on in-flight counting of IO.
However, commit 5b18b5a73760 changes io_ticks's accounting into the
following way:
stamp = READ_ONCE(part->stamp);
if (unlikely(stamp != now)) {
if (likely(cmpxchg(&part->stamp, stamp, now) == stamp))
__part_stat_add(part, io_ticks, 1);
}
So this way doesn't use any in-flight IO's info, simply adding 1 if stamp
changes compared with previous stamp, no matter if there is any in-flight
IO or not.
Now when there is very heavy IO on disks, %util is still much less than
100%, especially on HDD, the reason could be that IO latency can be much more
than 1ms in case of 1000HZ, so the above calculation is very inaccurate.
Another extreme example is that if IOs take long time to complete, such
as IO stall, %util may show 0% utilization, instead of 100%.
Thanks,
Ming
next reply other threads:[~2020-03-24 3:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-24 3:19 Ming Lei [this message]
2020-03-24 3:53 ` very inaccurate %util of iostat Mike Snitzer
2020-10-23 2:48 ` Weiping Zhang
2020-10-23 5:50 ` Weiping Zhang
[not found] ` <156351603710306@mail.yandex-team.ru>
2020-10-27 4:26 ` Weiping Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200324031942.GA3060@ming.t460p \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=snitzer@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox