Re: [PATCH -next 3/3] md: use interruptible apis in idle/frozen_sync_thread()
From: Song Liu <song@kernel.org>
Date: 2024-01-30 07:34:54
Also in:
lkml
On Mon, Jan 29, 2024 at 11:04 PM Yu Kuai [off-list ref] wrote:
Hi, 在 2024/01/30 14:37, Song Liu 写道:quoted
Hi, Sorry for the late reply. The first two patches of the set look good, so I applied them to md-tmp-6.9 branch. However, this one needs a respin.We are fixing dm-raid regressions, so I'll not send a new version until that work is done. :)
Sure. Fixing the regression is more urgent.
quoted
On Thu, Dec 28, 2023 at 4:58 AM Yu Kuai [off-list ref] wrote:quoted
From: Yu Kuai <redacted>
[...]
quoted
I found prepare_to_stop_sync_thread very hard to reason. Please try to rephrase the comment or refactor the code. Maybe it makes sense to put the following logic and its variations to a separate function: if (prepare_to_stop_sync_thread(mddev, false)) { wait_event(resync_wait, sync_thread_stopped(mddev, NULL)); mddev_lock_nointr(mddev); }I can do this, but there are 5 callers and only two of them can use the separate caller. Pehaps something like this? void stop_sync_thread(struct mddev *mddev, bool wait_sb) { if (prepare_to_stop_sync_thread(mddev, wait_sb)) { wait_event(resync_wait, ...); if (!wait_sb) { mddev_lock_nointr(mddev); return; } } if (wait_sb) { wait_event(sb_wait, ...); mddev_lock_nointr(mddev); } }
I don't really like this version either. Let's think more about this after fixing the dm-raid regressions. Thanks, Song
int stop_sync_thread_interruptible(struct mddev *mddev, bool check_sync_seq)
{
...
}