Skip to content

Commit 12907ef

Browse files
author
Mike Snitzer
committed
dm verity: have verify_wq use WQ_HIGHPRI if "try_verify_in_tasklet"
Allow verify_wq to preempt softirq since verification in tasklet will fall-back to using it for error handling (or if the bufio cache doesn't have required hashes). Suggested-by: Nathan Huckleberry <nhuck@google.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
1 parent 43fa47c commit 12907ef

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/md/dm-verity-target.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,7 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv)
11511151
struct dm_verity_sig_opts verify_args = {0};
11521152
struct dm_arg_set as;
11531153
unsigned int num;
1154+
unsigned int wq_flags;
11541155
unsigned long long num_ll;
11551156
int r;
11561157
int i;
@@ -1388,7 +1389,16 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv)
13881389
}
13891390

13901391
/* WQ_UNBOUND greatly improves performance when running on ramdisk */
1391-
v->verify_wq = alloc_workqueue("kverityd", WQ_MEM_RECLAIM | WQ_UNBOUND, num_online_cpus());
1392+
wq_flags = WQ_MEM_RECLAIM | WQ_UNBOUND;
1393+
if (v->use_tasklet) {
1394+
/*
1395+
* Allow verify_wq to preempt softirq since verification in
1396+
* tasklet will fall-back to using it for error handling
1397+
* (or if the bufio cache doesn't have required hashes).
1398+
*/
1399+
wq_flags |= WQ_HIGHPRI;
1400+
}
1401+
v->verify_wq = alloc_workqueue("kverityd", wq_flags, num_online_cpus());
13921402
if (!v->verify_wq) {
13931403
ti->error = "Cannot allocate workqueue";
13941404
r = -ENOMEM;

0 commit comments

Comments
 (0)