diff options
author | Jim Kukunas <james.t.kukunas@linux.intel.com> | 2012-05-22 13:54:04 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-05-22 13:54:04 +1000 |
commit | bdf981e560308c58c69b8adc6da6544cb9ec4c3c (patch) | |
tree | 9099111409334f7da63ea6ecd06362c121893371 | |
parent | 86a6bf2803f7252480bed3c36b9bb0775888308f (diff) | |
download | linux-crypto-bdf981e560308c58c69b8adc6da6544cb9ec4c3c.tar.gz linux-crypto-bdf981e560308c58c69b8adc6da6544cb9ec4c3c.zip |
crypto: disable preemption while benchmarking RAID5 xor checksumming
With CONFIG_PREEMPT=y, we need to disable preemption while benchmarking
RAID5 xor checksumming to ensure we're actually measuring what we think
we're measuring.
Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to '')
-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 87884435..84daa111 100644 --- a/crypto/xor.c +++ b/crypto/xor.c @@ -21,6 +21,7 @@ #include <linux/gfp.h> #include <linux/raid/xor.h> #include <linux/jiffies.h> +#include <linux/preempt.h> #include <asm/xor.h> /* The xor routines to use. */ @@ -69,6 +70,8 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) tmpl->next = template_list; template_list = tmpl; + preempt_disable(); + /* * Count the number of XORs done during a whole jiffy, and use * 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) max = count; } + preempt_enable(); + speed = max * (HZ * BENCH_SIZE / 1024); tmpl->speed = speed; |