From: Josh Snyder <joshs@netflix.com>
To: Hou Tao <houtao1@huawei.com>, Jens Axboe <axboe@kernel.dk>,
Mikulas Patocka <mpatocka@redhat.com>,
Mike Snitzer <snitzer@redhat.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Josh Snyder <josh@code406.com>, Ming Lei <ming.lei@redhat.com>
Subject: Re: [RFC 1/2] Eliminate over- and under-counting of io_ticks
Date: Wed, 10 Jun 2020 00:26:05 -0700 [thread overview]
Message-ID: <a026a60f-e319-de35-8274-fb14ada29eff@netflix.com> (raw)
In-Reply-To: <0b7e623e-2146-5e44-f486-ba9e1657f2a3@huawei.com>
Hello!
On 6/9/20 6:41 PM, Hou Tao wrote:
> Hi,
>
> For the following case, the under-counting is still possible if io2 wins cmpxchg():
>
> t 0123456
> io1 |-----|
> io2 |--|
> stamp 0 6
> io_ticks 0 3
I hadn't noticed that bug. It looks like it can produce an unbounded quantity of undercount.
> However considering patch 2 tries to improve sampling rate to 1 us, the problem will gone.
Now that you mention it, the below case is also poorly handled, and will be incorrect
regardless of sampling frequency. It experiences issues both under this patch (labeled
io_ticks) and the current implementation (labeled io_ticks~):
t 0123456
io1 |-----|
io2 |-|
stamp 0 56
io_ticks 28
stamp~ 0 3 56
io_ticks~ 1 34
I am beginning to doubt whether it is even possible to produce an algorithm that is
simultaneously unbiased and synchronization-lite. At the same time, Ming's comment on
patch 2 was leading me to wonder about the value of being synchronization-lite in the
first place. At the proposed sampling rate of 1M/s, it is unlikely that we'd ever exercise
the synchronization-free code path (and, as your case shows, incorrect). And for every
block device that I'm aware of (even the ones that return in 10us), the cost of a disk
access still completely dominates the cost of a locked CPU operation by three orders of
magnitude.
Josh
next prev parent reply other threads:[~2020-06-10 7:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-09 4:07 [RFC 0/2] Increase accuracy and precision of sampled io_ticks Josh Snyder
2020-06-09 4:07 ` [RFC 1/2] Eliminate over- and under-counting of io_ticks Josh Snyder
2020-06-09 8:08 ` Ming Lei
2020-06-10 1:41 ` Hou Tao
2020-06-10 7:26 ` Josh Snyder [this message]
2020-06-09 4:07 ` [RFC 2/2] Track io_ticks at microsecond granularity Josh Snyder
2020-06-09 8:50 ` Ming Lei
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=a026a60f-e319-de35-8274-fb14ada29eff@netflix.com \
--to=joshs@netflix.com \
--cc=axboe@kernel.dk \
--cc=houtao1@huawei.com \
--cc=josh@code406.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--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