From: Yu Kuai <yukuai1@huaweicloud.com>
To: axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com, xni@redhat.com
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-raid@vger.kernel.org, yukuai1@huaweicloud.com,
yi.zhang@huawei.com, yangerkun@huawei.com
Subject: [PATCH 0/4] md: fix is_mddev_idle()
Date: Sat, 12 Apr 2025 15:31:58 +0800 [thread overview]
Message-ID: <20250412073202.3085138-1-yukuai1@huaweicloud.com> (raw)
From: Yu Kuai <yukuai3@huawei.com>
If sync_speed is above speed_min, then is_mddev_idle() will be called
for each sync IO to check if the array is idle, and inflihgt sync_io
will be limited if the array is not idle.
However, while mkfs.ext4 for a large raid5 array while recovery is in
progress, it's found that sync_speed is already above speed_min while
lots of stripes are used for sync IO, causing long delay for mkfs.ext4.
Root cause is the following checking from is_mddev_idle():
t1: submit sync IO: events1 = completed IO - issued sync IO
t2: submit next sync IO: events2 = completed IO - issued sync IO
if (events2 - events1 > 64)
For consequence, the more sync IO issued, the less likely checking will
pass. And when completed normal IO is more than issued sync IO, the
condition will finally pass and is_mddev_idle() will return false,
however, last_events will be updated hence is_mddev_idle() can only
return false once in a while.
Fix this problem by changing the checking as following:
1) mddev doesn't have normal IO completed;
2) mddev doesn't have normal IO inflight;
3) if any member disks is partition, and all other partitions doesn't
have IO completed.
Yu Kuai (4):
block: export part_in_flight()
md: add a new api sync_io_depth
md: fix is_mddev_idle()
md: cleanup accounting for issued sync IO
block/blk.h | 1 -
block/genhd.c | 1 +
drivers/md/md.c | 181 ++++++++++++++++++++++++++------------
drivers/md/md.h | 15 +---
drivers/md/raid1.c | 3 -
drivers/md/raid10.c | 9 --
drivers/md/raid5.c | 8 --
include/linux/blkdev.h | 1 -
include/linux/part_stat.h | 1 +
9 files changed, 130 insertions(+), 90 deletions(-)
--
2.39.2
next reply other threads:[~2025-04-12 7:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-12 7:31 Yu Kuai [this message]
2025-04-12 7:31 ` [PATCH 1/4] block: export part_in_flight() Yu Kuai
2025-04-14 6:32 ` Christoph Hellwig
2025-04-14 6:48 ` Yu Kuai
2025-04-14 11:39 ` Christoph Hellwig
2025-04-12 7:32 ` [PATCH 2/4] md: add a new api sync_io_depth Yu Kuai
2025-04-16 5:32 ` Xiao Ni
2025-04-16 8:19 ` Yu Kuai
2025-04-12 7:32 ` [PATCH 3/4] md: fix is_mddev_idle() Yu Kuai
2025-04-16 6:20 ` Xiao Ni
2025-04-16 7:42 ` Yu Kuai
2025-04-16 9:28 ` Yu Kuai
2025-04-16 9:44 ` Xiao Ni
2025-04-17 1:47 ` Yu Kuai
2025-04-12 7:32 ` [PATCH 4/4] md: cleanup accounting for issued sync IO Yu Kuai
2025-04-16 6:27 ` Xiao Ni
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=20250412073202.3085138-1-yukuai1@huaweicloud.com \
--to=yukuai1@huaweicloud.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=song@kernel.org \
--cc=xni@redhat.com \
--cc=yangerkun@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox