From: "yukuai (C)" <yukuai3@huawei.com>
To: <axboe@kernel.dk>, Ming Lei <ming.lei@redhat.com>, <hch@lst.de>,
<linux-block@vger.kernel.org>, chenzhou <chenzhou10@huawei.com>,
"houtao (A)" <houtao1@huawei.com>
Subject: question about relative control for sync io using bfq
Date: Mon, 11 Jan 2021 21:15:13 +0800 [thread overview]
Message-ID: <b4163392-0462-ff6f-b958-1f96f33d69e6@huawei.com> (raw)
Hi,
We found a performance problem:
kernel version: 5.10
disk: ssd
scheduler: bfq
arch: arm64 / x86_64
test param: direct=1, ioengine=psync, bs=4k, rw=randread, numjobs=32
We are using 32 threads here, test results showed that iops is equal
to single thread.
After digging into the problem, I found root cause of the problem is
strange:
bfq_add_request
bfq_bfqq_handle_idle_busy_switch
bfq_add_bfqq_busy
bfq_activate_bfq
bfq_activate_requeue_entity
__bfq_activate_requeue_entity
__bfq_activate_entity
if (!bfq_entity_to_bfqq(entity))
if (!entity->in_groups_with_pending_reqs)
entity->in_groups_with_pending_reqs = true;
bfqd->num_groups_with_pending_reqs++
If test process is not in root cgroup, num_groups_with_pending_reqs will
be increased after request was instered to bfq.
bfq_select_queue
bfq_better_to_idle
idling_needed_for_service_guarantees
bfq_asymmetric_scenario
return varied_queue_weights || multiple_classes_busy ||
bfqd->num_groups_with_pending_reqs > 0
After issuing IO to driver, num_groups_with_pending_reqs is ensured to
be nonzero, thus bfq won't expire the queue. This is the root cause of
degradating to single-process performance.
One the other hand, if I set slice_idle to zero, bfq_better_to_idle will
return false early, and the problem will disapear. However, relative
control will be inactive.
My question is that, is this a known flaw for bfq? If not, as cfq don't
have such problem, is there a suitable solution?
Thanks!
Yu Kuai
such problem,
next reply other threads:[~2021-01-11 13:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-11 13:15 yukuai (C) [this message]
2021-01-14 12:24 ` [PATCH] bfq: don't check active group if bfq.weight is not changed Yu Kuai
2021-01-14 12:24 ` Yu Kuai
2021-01-15 13:35 ` kernel test robot
2021-01-15 13:35 ` kernel test robot
2021-01-15 13:35 ` kernel test robot
2021-01-15 13:35 ` kernel test robot
2021-01-15 13:35 ` kernel test robot
2021-01-15 13:35 ` kernel test robot
2021-01-22 9:46 ` Paolo Valente
2021-01-22 9:46 ` Paolo Valente
2021-01-16 8:59 ` question about relative control for sync io using bfq yukuai (C)
2021-01-16 10:45 ` Paolo Valente
2021-01-22 10:09 ` Paolo Valente
[not found] ` <7c28a80f-dea9-d701-0399-a22522c4509b@huawei.com>
2021-02-05 7:49 ` Paolo Valente
2021-02-07 12:49 ` yukuai (C)
2021-02-08 19:05 ` Paolo Valente
2021-02-19 12:03 ` yukuai (C)
2021-02-23 10:52 ` Paolo Valente
2021-02-24 9:30 ` 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=b4163392-0462-ff6f-b958-1f96f33d69e6@huawei.com \
--to=yukuai3@huawei.com \
--cc=axboe@kernel.dk \
--cc=chenzhou10@huawei.com \
--cc=hch@lst.de \
--cc=houtao1@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@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 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.