[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230425115256.3663932-4-yukuai1@huaweicloud.com>
Date: Tue, 25 Apr 2023 19:52:54 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: logang@...tatee.com, axboe@...nel.dk, song@...nel.org
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-raid@...r.kernel.org, yukuai3@...wei.com,
yukuai1@...weicloud.com, yi.zhang@...wei.com, yangerkun@...wei.com
Subject: [PATCH -next v7 3/5] md/bitmap: always wake up md_thread in timeout_store
From: Yu Kuai <yukuai3@...wei.com>
md_wakeup_thread() can handle the case that pass in md_thread is NULL,
the only difference is that md_wakeup_thread() will be called when
current timeout is 'MAX_SCHEDULE_TIMEOUT', this should not matter
because timeout_store() is not hot path, and the daemon process is
woke up more than demand from other context already.
This patch prepare to factor out a helper to set timeout.
Signed-off-by: Yu Kuai <yukuai3@...wei.com>
---
drivers/md/md-bitmap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
index 920bb68156d2..06b980f71a6b 100644
--- a/drivers/md/md-bitmap.c
+++ b/drivers/md/md-bitmap.c
@@ -2475,11 +2475,11 @@ timeout_store(struct mddev *mddev, const char *buf, size_t len)
* the bitmap is all clean and we don't need to
* adjust the timeout right now
*/
- if (mddev->thread->timeout < MAX_SCHEDULE_TIMEOUT) {
+ if (mddev->thread->timeout < MAX_SCHEDULE_TIMEOUT)
mddev->thread->timeout = timeout;
- md_wakeup_thread(mddev->thread);
- }
}
+
+ md_wakeup_thread(mddev->thread);
return len;
}
--
2.39.2
Powered by blists - more mailing lists