提交 204d1a64 编写于 作者: P Pankaj Gupta 提交者: Song Liu

md: add comments in md_flush_request()

Request coalescing logic is dependent on flush time update in other
context. This patch adds comments to understand the code flow better.
Signed-off-by: NPankaj Gupta <pankaj.gupta@cloud.ionos.com>
Signed-off-by: NSong Liu <songliubraving@fb.com>
上级 81ba3c24
......@@ -662,10 +662,14 @@ bool md_flush_request(struct mddev *mddev, struct bio *bio)
{
ktime_t req_start = ktime_get_boottime();
spin_lock_irq(&mddev->lock);
/* flush requests wait until ongoing flush completes,
* hence coalescing all the pending requests.
*/
wait_event_lock_irq(mddev->sb_wait,
!mddev->flush_bio ||
ktime_after(mddev->prev_flush_start, req_start),
mddev->lock);
/* new request after previous flush is completed */
if (!ktime_after(mddev->prev_flush_start, req_start)) {
WARN_ON(mddev->flush_bio);
mddev->flush_bio = bio;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册