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 <[email protected]>
Tested-by: Yan Li <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Alasdair G Kergon <[email protected]>
case 0:
atomic_dec(&ctx->pending);
ctx->sector++;
+ cond_resched();
continue;
/* error */