All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Yu Kuai <yukuai3@huawei.com>,
	andriy.shevchenko@linux.intel.com, john.garry@huawei.com,
	ming.lei@redhat.com
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	yi.zhang@huawei.com
Subject: Re: [PATCH -next RFC 0/6] improve large random io for HDD
Date: Tue, 29 Mar 2022 06:53:43 -0600	[thread overview]
Message-ID: <a3e78af2-b0e3-9a97-5bbd-4bdbc5c5a58d@kernel.dk> (raw)
In-Reply-To: <20220329094048.2107094-1-yukuai3@huawei.com>

On 3/29/22 3:40 AM, Yu Kuai wrote:
> There is a defect for blk-mq compare to blk-sq, specifically split io
> will end up discontinuous if the device is under high io pressure, while
> split io will still be continuous in sq, this is because:
> 
> 1) split bio is issued one by one, if one bio can't get tag, it will go
> to wail. - patch 2
> 2) each time 8(or wake batch) requests is done, 8 waiters will be woken up.
> Thus if a thread is woken up, it will unlikey to get multiple tags.
> - patch 3,4
> 3) new io can preempt tag even if there are lots of threads waiting for
> tags. - patch 5
> 
> Test environment:
> x86 vm, nr_requests is set to 64, queue_depth is set to 32 and
> max_sectors_kb is set to 128.
> 
> I haven't tested this patchset on physical machine yet, I'll try later
> if anyone thinks this approch is meaningful.

A real machine test would definitely be a requirement. What real world
uses cases is this solving? These days most devices have plenty of tags,
and I would not really expect tag starvation to be much of a concern.

However, I do think there's merrit in fixing the unfairness we have
here. But not at the cost of all of this. Why not just simply enforce
more strict ordering of tag allocations? If someone is waiting, you get
to wait too.

And I don't see much utility at all in tracking how many splits (and
hence tags) would be required. Is this really a common issue, tons of
splits and needing many tags? Why not just enforce the strict ordering
as mentioned above, not allowing new allocators to get a tag if others
are waiting, but perhaps allow someone submitting a string of splits to
indeed keep allocating.

Yes, it'll be less efficient to still wake one-by-one, but honestly do
we really care about that? If you're stalled on waiting for other IO to
finish and release a tag, that isn't very efficient to begin with and
doesn't seem like a case worth optimizing for me.

-- 
Jens Axboe


  parent reply	other threads:[~2022-03-29 12:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29  9:40 [PATCH -next RFC 0/6] improve large random io for HDD Yu Kuai
2022-03-29  9:40 ` [PATCH -next RFC 1/6] blk-mq: add a new flag 'BLK_MQ_F_NO_TAG_PREEMPTION' Yu Kuai
2022-03-29 12:44   ` Jens Axboe
2022-03-30  1:18     ` yukuai (C)
2022-03-30  1:20       ` Jens Axboe
2022-03-29  9:40 ` [PATCH -next RFC 2/6] block: refactor to split bio thoroughly Yu Kuai
2022-03-29 12:46   ` Jens Axboe
2022-03-30  1:35     ` yukuai (C)
2022-03-29 13:32   ` Christoph Hellwig
2022-03-29 14:35     ` Jens Axboe
2022-03-29 14:40       ` Christoph Hellwig
2022-03-29 14:41         ` Jens Axboe
2022-03-29 14:42           ` Christoph Hellwig
2022-03-30  1:54           ` yukuai (C)
2022-03-29  9:40 ` [PATCH -next RFC 3/6] blk-mq: record how many tags are needed for splited bio Yu Kuai
2022-03-29  9:40 ` [PATCH -next RFC 4/6] sbitmap: wake up the number of threads based on required tags Yu Kuai
2022-03-29  9:40 ` [PATCH -next RFC 5/6] blk-mq: don't preempt tag expect for split bios Yu Kuai
2022-03-29  9:40 ` [PATCH -next RFC 6/6] sbitmap: force tag preemption if free tags are sufficient Yu Kuai
2022-03-29 12:53 ` Jens Axboe [this message]
2022-03-30  2:05   ` [PATCH -next RFC 0/6] improve large random io for HDD yukuai (C)

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=a3e78af2-b0e3-9a97-5bbd-4bdbc5c5a58d@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=john.garry@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.