From: Milan Broz Date: Wed, 2 Jul 2008 08:34:28 +0000 (+0100) Subject: dm crypt: use cond_resched X-Git-Tag: v2.6.26-rc9~81^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c7f1b2044191a82e7f0a1a674751ed582289e2e0;p=linux-2.6-omap-h63xx.git 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 Tested-by: Yan Li Signed-off-by: Andrew Morton Signed-off-by: Alasdair G Kergon --- diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 835def11419..ab6a61db63c 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -432,6 +432,7 @@ static int crypt_convert(struct crypt_config *cc, case 0: atomic_dec(&ctx->pending); ctx->sector++; + cond_resched(); continue; /* error */