From: Milan Broz 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 Signed-off-by: Alasdair G Kergon Tested-by: Yan Li Cc: Signed-off-by: Andrew Morton --- drivers/md/dm-crypt.c | 1 + 1 files changed, 1 insertion(+) Index: linux-2.6.26-rc8/drivers/md/dm-crypt.c =================================================================== --- linux-2.6.26-rc8.orig/drivers/md/dm-crypt.c 2008-06-30 11:11:55.000000000 +0100 +++ linux-2.6.26-rc8/drivers/md/dm-crypt.c 2008-06-30 11:13:35.000000000 +0100 @@ -432,6 +432,7 @@ static int crypt_convert(struct crypt_co case 0: atomic_dec(&ctx->pending); ctx->sector++; + cond_resched(); continue; /* error */