Commit 56a51991 authored by Jim Kukunas's avatar Jim Kukunas Committed by NeilBrown

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: default avatarJim Kukunas <james.t.kukunas@linux.intel.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 6a328475
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/raid/xor.h> #include <linux/raid/xor.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/preempt.h>
#include <asm/xor.h> #include <asm/xor.h>
/* The xor routines to use. */ /* The xor routines to use. */
...@@ -69,6 +70,8 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) ...@@ -69,6 +70,8 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2)
tmpl->next = template_list; tmpl->next = template_list;
template_list = tmpl; template_list = tmpl;
preempt_disable();
/* /*
* Count the number of XORs done during a whole jiffy, and use * Count the number of XORs done during a whole jiffy, and use
* this to calculate the speed of checksumming. We use a 2-page * 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,6 +94,8 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2)
max = count; max = count;
} }
preempt_enable();
speed = max * (HZ * BENCH_SIZE / 1024); speed = max * (HZ * BENCH_SIZE / 1024);
tmpl->speed = speed; tmpl->speed = speed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment