From: "yu kuai" <yukuai@fygo.io>
To: "Yunye Zhao" <yunye.zhao@linux.alibaba.com>,
"Song Liu" <song@kernel.org>, "yu kuai" <yukuai@fygo.io>
Cc: "Li Nan" <magiclinan@didiglobal.com>, "Xiao Ni" <xiao@kernel.org>,
"Joseph Qi" <joseph.qi@linux.alibaba.com>,
<linux-raid@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] md: add cond_resched() to md_do_sync()'s skip path
Date: Fri, 7 Aug 2026 16:11:52 +0800 [thread overview]
Message-ID: <6de0a94e-de24-40e7-b0af-d15b5787988c@fygo.io> (raw)
In-Reply-To: <20260723135535.101995-3-yunye.zhao@linux.alibaba.com>
在 2026/7/23 21:55, Yunye Zhao 写道:
> When sync_request() reports a skipped region (*skipped == 1),
> md_do_sync()'s main loop advances the cursor and takes an early
> continue:
>
> j += sectors;
> ...
> if (last_check + window > io_sectors || j == max_sectors)
> continue;
>
> If the personality returns a small span per call (raid10 recovery
> returns only 128 sectors), syncing a large, mostly clean array iterates
> this branch an enormous number of times without ever yielding the CPU.
> On a non-preemptive kernel the resync thread then trips the soft-lockup
> watchdog:
>
> watchdog: BUG: soft lockup - CPU#149 stuck for 313s! [mdX_resync]
> md_bitmap_start_sync+0x6f/0xe0
> raid10_sync_request+0x2c9/0x1530 [raid10]
> md_do_sync+0x810/0x1030
> md_thread+0xa7/0x150
>
> Add a cond_resched(). This does not reduce the wasted iterations; the
> excessive iteration count is a raid10 problem addressed separately.
>
> Cc:stable@vger.kernel.org
> Signed-off-by: Yunye Zhao<yunye.zhao@linux.alibaba.com>
Remove the cc stable as there is no fixtag.
> ---
> drivers/md/md.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Applied to md-7.3
--
Thanks,
Kuai
next prev parent reply other threads:[~2026-08-07 8:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 6:27 [PATCH] md: fix soft lockup during resync when sync is repeatedly skipped Yunye Zhao
2026-07-19 10:45 ` yu kuai
2026-07-20 6:20 ` Yunye Zhao
2026-07-22 4:00 ` yu kuai
2026-07-23 13:55 ` [PATCH v2 0/3] md/raid10: fix recovery corruption and soft lockup on large arrays Yunye Zhao
2026-07-23 13:55 ` [PATCH v2 1/3] md/raid10: fix still_degraded being inverted in raid10_sync_request() Yunye Zhao
2026-07-26 12:25 ` Mykola Marzhan
2026-07-27 2:43 ` Yunye Zhao
2026-08-07 8:11 ` yu kuai
2026-07-23 13:55 ` [PATCH v2 2/3] md: add cond_resched() to md_do_sync()'s skip path Yunye Zhao
2026-08-07 8:11 ` yu kuai [this message]
2026-07-23 13:55 ` [PATCH v2 3/3] md/raid10: skip clean regions in bulk during recovery Yunye Zhao
2026-07-31 9:46 ` yu kuai
2026-08-04 3:55 ` Yunye Zhao
2026-08-04 6:57 ` yu kuai
2026-08-04 9:01 ` Yunye Zhao
2026-08-04 11:47 ` yu kuai
2026-08-07 9:05 ` Yunye Zhao
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=6de0a94e-de24-40e7-b0af-d15b5787988c@fygo.io \
--to=yukuai@fygo.io \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=magiclinan@didiglobal.com \
--cc=song@kernel.org \
--cc=xiao@kernel.org \
--cc=yunye.zhao@linux.alibaba.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
all inboxes | Powered by JetHome®