lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231128094414.583666-1-yunlong.xing@unisoc.com>
Date:   Tue, 28 Nov 2023 17:44:14 +0800
From:   Yunlong Xing <yunlong.xing@...soc.com>
To:     <agk@...hat.com>, <snitzer@...nel.org>, <mpatocka@...hat.com>,
        <dm-devel@...ts.linux.dev>, <linux-kernel@...r.kernel.org>
CC:     <yibin.ding@...soc.com>, <hongyu.jin@...soc.com>,
        <dongliang.cui@...soc.com>, <yunlong.xing@...soc.com>,
        <xiuhong.wang@...soc.com>
Subject: [PATCH] dm: increase the io priority of the kworker-kverityd process

From: Hongyu Jin <hongyu.jin@...soc.com>

When obtaining the hash value of a high IO priority data block
from the disk, the kverity-worker that obtains the hash will
also have a high IO priority to avoid being blocked by other
IO with low IO priority.

Signed-off-by: Hongyu Jin <hongyu.jin@...soc.com>
Signed-off-by: Yibin Ding <yibin.ding@...soc.com>
---
 drivers/md/dm-verity-target.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c
index e115fcfe723c..ade9c6734154 100644
--- a/drivers/md/dm-verity-target.c
+++ b/drivers/md/dm-verity-target.c
@@ -22,6 +22,7 @@
 #include <linux/scatterlist.h>
 #include <linux/string.h>
 #include <linux/jump_label.h>
+#include <linux/ioprio.h>
 
 #define DM_MSG_PREFIX			"verity"
 
@@ -639,7 +640,9 @@ static void verity_finish_io(struct dm_verity_io *io, blk_status_t status)
 static void verity_work(struct work_struct *w)
 {
 	struct dm_verity_io *io = container_of(w, struct dm_verity_io, work);
+	struct bio *bio = dm_bio_from_per_bio_data(io, io->v->ti->per_io_data_size);
 
+	set_task_ioprio(current, bio->bi_ioprio);
 	io->in_tasklet = false;
 
 	verity_fec_init_io(io);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ