diff options
Diffstat (limited to 'crypto/xor.c')
-rw-r--r-- | crypto/xor.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/xor.c b/crypto/xor.c index 87884435bddb..84daa1111dad 100644 --- a/crypto/xor.c +++ b/crypto/xor.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/gfp.h> | 21 | #include <linux/gfp.h> |
22 | #include <linux/raid/xor.h> | 22 | #include <linux/raid/xor.h> |
23 | #include <linux/jiffies.h> | 23 | #include <linux/jiffies.h> |
24 | #include <linux/preempt.h> | ||
24 | #include <asm/xor.h> | 25 | #include <asm/xor.h> |
25 | 26 | ||
26 | /* The xor routines to use. */ | 27 | /* The xor routines to use. */ |
@@ -69,6 +70,8 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) | |||
69 | tmpl->next = template_list; | 70 | tmpl->next = template_list; |
70 | template_list = tmpl; | 71 | template_list = tmpl; |
71 | 72 | ||
73 | preempt_disable(); | ||
74 | |||
72 | /* | 75 | /* |
73 | * Count the number of XORs done during a whole jiffy, and use | 76 | * Count the number of XORs done during a whole jiffy, and use |
74 | * this to calculate the speed of checksumming. We use a 2-page | 77 | * this to calculate the speed of checksumming. We use a 2-page |
@@ -91,6 +94,8 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) | |||
91 | max = count; | 94 | max = count; |
92 | } | 95 | } |
93 | 96 | ||
97 | preempt_enable(); | ||
98 | |||
94 | speed = max * (HZ * BENCH_SIZE / 1024); | 99 | speed = max * (HZ * BENCH_SIZE / 1024); |
95 | tmpl->speed = speed; | 100 | tmpl->speed = speed; |
96 | 101 | ||