Re: [PATCH] dm: increase the io priority of the kworker-kverityd process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> Signed-off-by: Yibin Ding <yibin.ding@xxxxxxxxxx>
> ---
>  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
> 
> 





[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux