From: Jim Kukunas Date: Tue, 22 May 2012 03:54:04 +0000 (+1000) Subject: crypto: disable preemption while benchmarking RAID5 xor checksumming X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=56a519913eeba2bdae4d7ee39e80fab442c3836c;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Signed-off-by: NeilBrown --- 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 @@ #include #include #include +#include #include /* 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;