You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
dm crypt: use cond_resched
Add cond_resched() to prevent monopolising CPU when processing large bios. dm-crypt processes encryption of bios in sector units. If the bio request is big it can spend a long time in the encryption call. Signed-off-by: Milan Broz <mbroz@redhat.com> Tested-by: Yan Li <elliot.li.tech@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:
committed by
Alasdair G Kergon
parent
e1441b9a41
commit
c7f1b20441
@@ -432,6 +432,7 @@ static int crypt_convert(struct crypt_config *cc,
|
||||
case 0:
|
||||
atomic_dec(&ctx->pending);
|
||||
ctx->sector++;
|
||||
cond_resched();
|
||||
continue;
|
||||
|
||||
/* error */
|
||||
|
||||
Reference in New Issue
Block a user