From: Jens Axboe <axboe@kernel.dk>
To: Bart Van Assche <bvanassche@acm.org>, linux-block@vger.kernel.org
Subject: Re: [PATCH 3/4] block/mq-deadline: fallback to per-cpu insertion buckets under contention
Date: Fri, 19 Jan 2024 17:31:01 -0700 [thread overview]
Message-ID: <8ef6eba4-b7b1-48b4-84a3-db6a4e27a348@kernel.dk> (raw)
In-Reply-To: <af2f895c-ee57-41a1-ae14-1f531b5671e0@kernel.dk>
On 1/19/24 5:05 PM, Jens Axboe wrote:
> On 1/19/24 4:16 PM, Bart Van Assche wrote:
>> On 1/19/24 08:02, Jens Axboe wrote:
>>> If we attempt to insert a list of requests, but someone else is already
>>> running an insertion, then fallback to queueing that list internally and
>>> let the existing inserter finish the operation. The current inserter
>>> will either see and flush this list, of if it ends before we're done
>>> doing our bucket insert, then we'll flush it and insert ourselves.
>>>
>>> This reduces contention on the dd->lock, which protects any request
>>> insertion or dispatch, by having a backup point to insert into which
>>> will either be flushed immediately or by an existing inserter. As the
>>> alternative is to just keep spinning on the dd->lock, it's very easy
>>> to get into a situation where multiple processes are trying to do IO
>>> and all sit and spin on this lock.
>>
>> With this alternative patch I achieve 20% higher IOPS than with patch
>> 3/4 of this series for 1..4 CPU cores (null_blk + fio in an x86 VM):
>
> Performance aside, I think this is a much better approach rather than
> mine. Haven't tested yet, but I think this instead of my patch 3 and the
> other patches and this should further drastically cut down on the
> overhead. Can you send a "proper" patch and I'll just replace the one
> that I have?
Ran with this real quick and the incremental I sent, here's what I see.
For reference, this is before the series:
Device IOPS sys contention diff
====================================================
null_blk 879K 89% 93.6%
nvme0n1 901K 86% 94.5%
and now with the series:
Device IOPS sys contention diff
====================================================
null_blk 2867K 11.1% ~6.0% +326%
nvme0n1 3162K 9.9% ~5.0% +350%
which looks really good, it removes the last bit of contention that was
still there. And talk about a combined improvement...
--
Jens Axboe
next prev parent reply other threads:[~2024-01-20 0:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-19 16:02 [PATCHSET RFC v2 0/4] mq-deadline scalability improvements Jens Axboe
2024-01-19 16:02 ` [PATCH 1/4] block/mq-deadline: pass in queue directly to dd_insert_request() Jens Axboe
2024-01-19 23:35 ` Bart Van Assche
2024-01-19 16:02 ` [PATCH 2/4] block/mq-deadline: serialize request dispatching Jens Axboe
2024-01-19 23:24 ` Bart Van Assche
2024-01-20 0:00 ` Jens Axboe
2024-01-19 16:02 ` [PATCH 3/4] block/mq-deadline: fallback to per-cpu insertion buckets under contention Jens Axboe
2024-01-19 23:16 ` Bart Van Assche
2024-01-20 0:05 ` Jens Axboe
2024-01-20 0:13 ` Jens Axboe
2024-01-20 0:31 ` Jens Axboe [this message]
2024-01-22 23:55 ` Bart Van Assche
2024-01-19 16:02 ` [PATCH 4/4] block/mq-deadline: skip expensive merge lookups if contended Jens Axboe
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=8ef6eba4-b7b1-48b4-84a3-db6a4e27a348@kernel.dk \
--to=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=linux-block@vger.kernel.org \
/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