[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <83e8ea6c-1d9-36d5-1c23-da686dbfaf80@redhat.com>
Date: Tue, 28 Nov 2023 15:07:29 +0100 (CET)
From: Mikulas Patocka <mpatocka@...hat.com>
To: Yunlong Xing <yunlong.xing@...soc.com>
cc: agk@...hat.com, snitzer@...nel.org, dm-devel@...ts.linux.dev,
linux-kernel@...r.kernel.org, yibin.ding@...soc.com,
hongyu.jin@...soc.com, dongliang.cui@...soc.com,
xiuhong.wang@...soc.com
Subject: Re: [PATCH] dm: increase the io priority of the kworker-kverityd
process
Hi
This isn't correct - the workqueue process is reused by multiple work
items - from dm-verity as well as from other subsystems - so you would be
unexpectedly boosting priority of other tasks.
The correct solution would be to set the ioprio field of the outcoming
bios in dm-bufio explicitely.
Mikulas
On Tue, 28 Nov 2023, Yunlong Xing wrote:
> 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