Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dm-verity: use softirq context only when !need_resched()

Further limit verification in softirq (a.k.a. BH) context to cases where
rescheduling of the interrupted task is not pending.

This helps prevent the CPU from spending too long in softirq context.

Note that handle_softirqs() in kernel/softirq.c already stops running
softirqs in this same case. However, that check is too coarse-grained,
since many I/O requests can be processed in a single BLOCK_SOFTIRQ.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

authored by

Eric Biggers and committed by
Mikulas Patocka
f9ed3121 abb4cf2f

+2 -1
+2 -1
drivers/md/dm-verity-target.c
··· 682 682 static inline bool verity_use_bh(unsigned int bytes, unsigned short ioprio) 683 683 { 684 684 return ioprio <= IOPRIO_CLASS_IDLE && 685 - bytes <= READ_ONCE(dm_verity_use_bh_bytes[ioprio]); 685 + bytes <= READ_ONCE(dm_verity_use_bh_bytes[ioprio]) && 686 + !need_resched(); 686 687 } 687 688 688 689 static void verity_end_io(struct bio *bio)