[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240621062617.595007-3-yi.sun@unisoc.com>
Date: Fri, 21 Jun 2024 14:26:17 +0800
From: Yi Sun <yi.sun@...soc.com>
To: <sunyibuaa@...il.com>, <tj@...nel.org>, <jaegeuk@...nel.org>,
<chao@...nel.org>
CC: <ebiggers@...gle.com>, <jiangshanlai@...il.com>,
<kent.overstreet@...ux.dev>, <linux-kernel@...r.kernel.org>,
<linux-f2fs-devel@...ts.sourceforge.net>, <niuzhiguo84@...il.com>,
<Hao_hao.Wang@...soc.com>, <yunlongxing23@...il.com>
Subject: [PATCH 2/2] f2fs: set f2fs verify work io priority
The io priority of reading the original data of the verity-file
and reading hash blocks during verification should be consistent.
If the io priority is not set, when a high-task-priority process
reads the verity-file, the kworker's io priority may be too low,
resulting in delayed reading of hash blocks, which eventually
causes the high-task-priority process to response slowly.
Signed-off-by: Yi Sun <yi.sun@...soc.com>
---
fs/f2fs/data.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index b9b0debc6b3d..705a2bdf0848 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -172,6 +172,8 @@ static void f2fs_verify_bio(struct work_struct *work)
struct bio *bio = ctx->bio;
bool may_have_compressed_pages = (ctx->enabled_steps & STEP_DECOMPRESS);
+ may_adjust_work_task_ioprio(work);
+
/*
* fsverity_verify_bio() may call readahead() again, and while verity
* will be disabled for this, decryption and/or decompression may still
@@ -204,6 +206,8 @@ static void f2fs_verify_bio(struct work_struct *work)
}
f2fs_finish_read_bio(bio, true);
+
+ restore_work_task_ioprio(work);
}
/*
@@ -221,6 +225,7 @@ static void f2fs_verify_and_finish_bio(struct bio *bio, bool in_task)
if (ctx && (ctx->enabled_steps & STEP_VERITY)) {
INIT_WORK(&ctx->work, f2fs_verify_bio);
+ set_work_ioprio(&ctx->work, bio->bi_ioprio);
fsverity_enqueue_verify_work(&ctx->work);
} else {
f2fs_finish_read_bio(bio, in_task);
--
2.25.1
Powered by blists - more mailing lists