diff options
author | Milan Broz <mbroz@redhat.com> | 2008-07-02 04:34:28 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2008-07-02 04:34:28 -0400 |
commit | c7f1b2044191a82e7f0a1a674751ed582289e2e0 (patch) | |
tree | c200c19aca2faf22ad5c8636a3a783f8e26ef289 | |
parent | e1441b9a41c33aa9236008a7cfe49a8e723fb397 (diff) |
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>
-rw-r--r-- | drivers/md/dm-crypt.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 835def11419d..ab6a61db63ce 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, | |||
432 | case 0: | 432 | case 0: |
433 | atomic_dec(&ctx->pending); | 433 | atomic_dec(&ctx->pending); |
434 | ctx->sector++; | 434 | ctx->sector++; |
435 | cond_resched(); | ||
435 | continue; | 436 | continue; |
436 | 437 | ||
437 | /* error */ | 438 | /* error */ |