From ee47fdf72392f5fe2772ad4bdadb2dc59564faeb Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 31 Aug 2026 11:22:57 +0200 Subject: [PATCH] Fix raid_gen_force parity count in benchmarks --- cmdline/speed.c | 93 +++++++++++++++++-------------------------- raid/test/speedtest.c | 80 +++++++++++++++++-------------------- 2 files changed, 72 insertions(+), 101 deletions(-) diff --git a/cmdline/speed.c b/cmdline/speed.c index 693ca716..a4839390 100644 --- a/cmdline/speed.c +++ b/cmdline/speed.c @@ -1255,7 +1255,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period) fflush(stdout); SPEED_START { - /* ensure to use same hardware in the delta step */ + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, sizeof(void*) == 8 ? raid_gen1_int64 : raid_gen1_int32); raid_rec1_int8(1, id, ip, nd, size, v); } SPEED_STOP @@ -1265,7 +1265,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_NEON SPEED_START { - /* raid_rec1of1() internally calls raid_gen() */ + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, raid_gen1_neon); raid_rec1_neon(1, id, ip, nd, size, v); } SPEED_STOP @@ -1275,7 +1275,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #endif #ifdef CONFIG_NEON32 SPEED_START { - /* raid_rec1of1() internally calls raid_gen() */ + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, raid_gen1_neon32); raid_rec1_neon32(1, id, ip, nd, size, v); } SPEED_STOP @@ -1287,7 +1287,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86 if (raid_cpu_has_ssse3()) { SPEED_START { - /* raid_rec1of1() internally calls raid_gen() */ + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, raid_gen1_sse2); raid_rec1_ssse3(1, id, ip, nd, size, v); } SPEED_STOP @@ -1297,7 +1297,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86_64 SPEED_START { - /* raid_rec1of1() internally calls raid_gen() */ + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, raid_gen1_sse2); raid_rec1_ssse3ext(1, id, ip, nd, size, v); } SPEED_STOP @@ -1308,7 +1308,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period) } if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, raid_gen1_avx2); raid_rec1_avx2(1, id, ip, nd, size, v); } SPEED_STOP @@ -1319,10 +1319,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86_64 if (raid_cpu_has_avx2()) { SPEED_START { - /* - * raid_rec1_avx2ext() uses raid_rec1of1() for P, - * which internally calls raid_gen(). - */ + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, raid_gen1_avx2); raid_rec1_avx2ext(1, id, ip, nd, size, v); } SPEED_STOP @@ -1364,8 +1361,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) fflush(stdout); SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, sizeof(void*) == 8 ? raid_gen1_int64 : raid_gen1_int32); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(2, sizeof(void*) == 8 ? raid_gen2_int64_raid : raid_gen2_int32_raid); /* +1 to avoid GEN1 optimized case */ raid_rec1_int8(1, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1395,8 +1392,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86 if (raid_cpu_has_ssse3()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_sse2); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(2, raid_gen2_sse2_raid); /* +1 to avoid GEN1 optimized case */ raid_rec1_ssse3(1, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1406,8 +1403,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86_64 SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_sse2); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(2, raid_gen2_sse2ext_raid); /* +1 to avoid GEN1 optimized case */ raid_rec1_ssse3ext(1, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1418,8 +1415,6 @@ void speed_rec(int nd, void** v, int size, int delta, int period) } if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_avx2); /* +1 to avoid GEN1 optimized case */ raid_rec1_avx2(1, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1430,8 +1425,6 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86_64 if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_avx2); /* +1 to avoid GEN1 optimized case */ raid_rec1_avx2ext(1, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1476,8 +1469,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) fflush(stdout); SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, sizeof(void*) == 8 ? raid_gen1_int64 : raid_gen1_int32); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(3, raid_gen3_int8); /* +2 to select R instead of Q */ raid_rec1_int8(1, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1507,8 +1500,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86 if (raid_cpu_has_ssse3()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_sse2); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(3, raid_gen3_ssse3_raid); /* +2 to select R instead of Q */ raid_rec1_ssse3(1, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1518,8 +1511,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86_64 SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_sse2); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(3, raid_gen3_ssse3ext_raid); /* +2 to select R instead of Q */ raid_rec1_ssse3ext(1, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1530,8 +1523,6 @@ void speed_rec(int nd, void** v, int size, int delta, int period) } if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_avx2); /* +2 to select R instead of Q */ raid_rec1_avx2(1, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1542,8 +1533,6 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86_64 if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_avx2); /* +2 to select R instead of Q */ raid_rec1_avx2ext(1, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1588,7 +1577,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period) fflush(stdout); SPEED_START { - /* ensure to use same hardware in the delta step */ + /* force the parity generator used by raid_delta_gen() */ raid_gen_force(2, sizeof(void*) == 8 ? raid_gen2_int64_raid : raid_gen2_int32_raid); raid_rec2_int8(2, id, ip, nd, size, v); } SPEED_STOP @@ -1606,6 +1595,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #endif #ifdef CONFIG_NEON32 SPEED_START { + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(2, raid_gen2_neon32_raid); raid_rec2_neon32(2, id, ip, nd, size, v); } SPEED_STOP @@ -1616,7 +1607,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86 if (raid_cpu_has_ssse3()) { SPEED_START { - /* ensure to use same hardware in the delta step */ + /* force the parity generator used by raid_delta_gen() */ raid_gen_force(2, raid_gen2_sse2_raid); raid_rec2_ssse3(2, id, ip, nd, size, v); } SPEED_STOP @@ -1626,7 +1617,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86_64 SPEED_START { - /* ensure to use same hardware in the delta step */ + /* force the parity generator used by raid_delta_gen() */ raid_gen_force(2, raid_gen2_sse2ext_raid); raid_rec2_ssse3ext(2, id, ip, nd, size, v); } SPEED_STOP @@ -1637,8 +1628,6 @@ void speed_rec(int nd, void** v, int size, int delta, int period) } if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_avx2_raid); raid_rec2_avx2(2, id, ip, nd, size, v); } SPEED_STOP @@ -1648,8 +1637,6 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86_64 if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_avx2ext_raid); raid_rec2_avx2ext(2, id, ip, nd, size, v); } SPEED_STOP @@ -1690,8 +1677,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) fflush(stdout); SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, sizeof(void*) == 8 ? raid_gen2_int64_raid : raid_gen2_int32_raid); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(3, raid_gen3_int8); /* +1 to avoid GEN2 optimized case */ raid_rec2_int8(2, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1721,8 +1708,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86 if (raid_cpu_has_ssse3()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_sse2_raid); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(3, raid_gen3_ssse3_raid); /* +1 to avoid GEN2 optimized case */ raid_rec2_ssse3(2, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1732,8 +1719,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86_64 SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_sse2ext_raid); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(3, raid_gen3_ssse3ext_raid); /* +1 to avoid GEN2 optimized case */ raid_rec2_ssse3ext(2, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1744,8 +1731,6 @@ void speed_rec(int nd, void** v, int size, int delta, int period) } if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_avx2_raid); /* +1 to avoid GEN2 optimized case */ raid_rec2_avx2(2, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1756,8 +1741,6 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86_64 if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_avx2ext_raid); /* +1 to avoid GEN2 optimized case */ raid_rec2_avx2ext(2, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1802,8 +1785,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) fflush(stdout); SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, sizeof(void*) == 8 ? raid_gen2_int64_raid : raid_gen2_int32_raid); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(4, raid_gen4_int8); /* +2 to select R,S instead of Q,R */ raid_rec2_int8(2, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1833,8 +1816,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86 if (raid_cpu_has_ssse3()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_sse2_raid); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(4, raid_gen4_ssse3_raid); /* +2 to select R,S instead of Q,R */ raid_rec2_ssse3(2, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1844,8 +1827,8 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86_64 SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_sse2ext_raid); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(4, raid_gen4_ssse3ext_raid); /* +2 to select R,S instead of Q,R */ raid_rec2_ssse3ext(2, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1856,8 +1839,6 @@ void speed_rec(int nd, void** v, int size, int delta, int period) } if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_avx2_raid); /* +2 to select R,S instead of Q,R */ raid_rec2_avx2(2, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1868,8 +1849,6 @@ void speed_rec(int nd, void** v, int size, int delta, int period) #ifdef CONFIG_X86_64 if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_avx2ext_raid); /* +2 to select R,S instead of Q,R */ raid_rec2_avx2ext(2, id, ip + 2, nd, size, v); } SPEED_STOP diff --git a/raid/test/speedtest.c b/raid/test/speedtest.c index f4ba4cee..d4f03a5f 100644 --- a/raid/test/speedtest.c +++ b/raid/test/speedtest.c @@ -1151,6 +1151,7 @@ void speed_rec(int nd, void **v, int size, int delta, int period) fflush(stdout); SPEED_START { + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, sizeof(void *) == 8 ? raid_gen1_int64 : raid_gen1_int32); raid_rec1_int8(1, id, ip, nd, size, v); } SPEED_STOP @@ -1160,7 +1161,7 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_NEON SPEED_START { - /* raid_rec1of1() internally calls raid_gen() */ + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, raid_gen1_neon); raid_rec1_neon(1, id, ip, nd, size, v); } SPEED_STOP @@ -1170,6 +1171,7 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #endif #ifdef CONFIG_NEON32 SPEED_START { + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, raid_gen1_neon32); raid_rec1_neon32(1, id, ip, nd, size, v); } SPEED_STOP @@ -1181,7 +1183,7 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86 if (raid_cpu_has_ssse3()) { SPEED_START { - /* raid_rec1of1() internally calls raid_gen() */ + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, raid_gen1_sse2); raid_rec1_ssse3(1, id, ip, nd, size, v); } SPEED_STOP @@ -1191,7 +1193,7 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86_64 SPEED_START { - /* raid_rec1of1() internally calls raid_gen() */ + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, raid_gen1_sse2); raid_rec1_ssse3ext(1, id, ip, nd, size, v); } SPEED_STOP @@ -1202,6 +1204,7 @@ void speed_rec(int nd, void **v, int size, int delta, int period) } if (raid_cpu_has_avx2()) { SPEED_START { + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, raid_gen1_avx2); raid_rec1_avx2(1, id, ip, nd, size, v); } SPEED_STOP @@ -1212,10 +1215,7 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86_64 if (raid_cpu_has_avx2()) { SPEED_START { - /* - * raid_rec1_avx2ext() uses raid_rec1of1() for P, - * which internally calls raid_gen(). - */ + /* force the parity generator used by raid_rec1of1() */ raid_gen_force(1, raid_gen1_avx2); raid_rec1_avx2ext(1, id, ip, nd, size, v); } SPEED_STOP @@ -1257,7 +1257,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) fflush(stdout); SPEED_START { - raid_gen_force(1, sizeof(void *) == 8 ? raid_gen1_int64 : raid_gen1_int32); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(2, sizeof(void *) == 8 ? raid_gen2_int64_raid : raid_gen2_int32_raid); /* +1 to avoid GEN1 optimized case */ raid_rec1_int8(1, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1287,8 +1288,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86 if (raid_cpu_has_ssse3()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_sse2); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(2, raid_gen2_sse2_raid); /* +1 to avoid GEN1 optimized case */ raid_rec1_ssse3(1, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1298,8 +1299,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86_64 SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_sse2); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(2, raid_gen2_sse2ext_raid); /* +1 to avoid GEN1 optimized case */ raid_rec1_ssse3ext(1, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1310,7 +1311,6 @@ void speed_rec(int nd, void **v, int size, int delta, int period) } if (raid_cpu_has_avx2()) { SPEED_START { - raid_gen_force(1, raid_gen1_avx2); /* +1 to avoid GEN1 optimized case */ raid_rec1_avx2(1, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1321,8 +1321,6 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86_64 if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_avx2); /* +1 to avoid GEN1 optimized case */ raid_rec1_avx2ext(1, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1367,7 +1365,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) fflush(stdout); SPEED_START { - raid_gen_force(1, sizeof(void *) == 8 ? raid_gen1_int64 : raid_gen1_int32); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(3, raid_gen3_int8); /* +2 to select R instead of Q */ raid_rec1_int8(1, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1397,8 +1396,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86 if (raid_cpu_has_ssse3()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_sse2); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(3, raid_gen3_ssse3_raid); /* +2 to select R instead of Q */ raid_rec1_ssse3(1, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1408,8 +1407,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86_64 SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_sse2); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(3, raid_gen3_ssse3ext_raid); /* +2 to select R instead of Q */ raid_rec1_ssse3ext(1, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1420,7 +1419,6 @@ void speed_rec(int nd, void **v, int size, int delta, int period) } if (raid_cpu_has_avx2()) { SPEED_START { - raid_gen_force(1, raid_gen1_avx2); /* +2 to select R instead of Q */ raid_rec1_avx2(1, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1431,8 +1429,6 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86_64 if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(1, raid_gen1_avx2); /* +2 to select R instead of Q */ raid_rec1_avx2ext(1, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1477,6 +1473,7 @@ void speed_rec(int nd, void **v, int size, int delta, int period) fflush(stdout); SPEED_START { + /* force the parity generator used by raid_delta_gen() */ raid_gen_force(2, sizeof(void *) == 8 ? raid_gen2_int64_raid : raid_gen2_int32_raid); raid_rec2_int8(2, id, ip, nd, size, v); } SPEED_STOP @@ -1494,6 +1491,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #endif #ifdef CONFIG_NEON32 SPEED_START { + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(2, raid_gen2_neon32_raid); raid_rec2_neon32(2, id, ip, nd, size, v); } SPEED_STOP @@ -1504,7 +1503,7 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86 if (raid_cpu_has_ssse3()) { SPEED_START { - /* ensure to use same hardware in the delta step */ + /* force the parity generator used by raid_delta_gen() */ raid_gen_force(2, raid_gen2_sse2_raid); raid_rec2_ssse3(2, id, ip, nd, size, v); } SPEED_STOP @@ -1514,7 +1513,7 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86_64 SPEED_START { - /* ensure to use same hardware in the delta step */ + /* force the parity generator used by raid_delta_gen() */ raid_gen_force(2, raid_gen2_sse2ext_raid); raid_rec2_ssse3ext(2, id, ip, nd, size, v); } SPEED_STOP @@ -1525,7 +1524,6 @@ void speed_rec(int nd, void **v, int size, int delta, int period) } if (raid_cpu_has_avx2()) { SPEED_START { - raid_gen_force(2, raid_gen2_avx2_raid); raid_rec2_avx2(2, id, ip, nd, size, v); } SPEED_STOP @@ -1535,8 +1533,6 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86_64 if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_avx2ext_raid); raid_rec2_avx2ext(2, id, ip, nd, size, v); } SPEED_STOP @@ -1577,7 +1573,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) fflush(stdout); SPEED_START { - raid_gen_force(2, sizeof(void *) == 8 ? raid_gen2_int64_raid : raid_gen2_int32_raid); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(3, raid_gen3_int8); /* +1 to avoid GEN2 optimized case */ raid_rec2_int8(2, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1607,8 +1604,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86 if (raid_cpu_has_ssse3()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_sse2_raid); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(3, raid_gen3_ssse3_raid); /* +1 to avoid GEN2 optimized case */ raid_rec2_ssse3(2, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1618,8 +1615,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86_64 SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_sse2ext_raid); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(3, raid_gen3_ssse3ext_raid); /* +1 to avoid GEN2 optimized case */ raid_rec2_ssse3ext(2, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1630,7 +1627,6 @@ void speed_rec(int nd, void **v, int size, int delta, int period) } if (raid_cpu_has_avx2()) { SPEED_START { - raid_gen_force(2, raid_gen2_avx2_raid); /* +1 to avoid GEN2 optimized case */ raid_rec2_avx2(2, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1641,8 +1637,6 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86_64 if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_avx2ext_raid); /* +1 to avoid GEN2 optimized case */ raid_rec2_avx2ext(2, id, ip + 1, nd, size, v); } SPEED_STOP @@ -1687,7 +1681,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) fflush(stdout); SPEED_START { - raid_gen_force(2, sizeof(void *) == 8 ? raid_gen2_int64_raid : raid_gen2_int32_raid); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(4, raid_gen4_int8); /* +2 to select R,S instead of Q,R */ raid_rec2_int8(2, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1717,8 +1712,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86 if (raid_cpu_has_ssse3()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_sse2_raid); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(4, raid_gen4_ssse3_raid); /* +2 to select R,S instead of Q,R */ raid_rec2_ssse3(2, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1728,8 +1723,8 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86_64 SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_sse2ext_raid); + /* force the parity generator used by raid_delta_gen() */ + raid_gen_force(4, raid_gen4_ssse3ext_raid); /* +2 to select R,S instead of Q,R */ raid_rec2_ssse3ext(2, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1740,7 +1735,6 @@ void speed_rec(int nd, void **v, int size, int delta, int period) } if (raid_cpu_has_avx2()) { SPEED_START { - raid_gen_force(2, raid_gen2_avx2_raid); /* +2 to select R,S instead of Q,R */ raid_rec2_avx2(2, id, ip + 2, nd, size, v); } SPEED_STOP @@ -1751,8 +1745,6 @@ void speed_rec(int nd, void **v, int size, int delta, int period) #ifdef CONFIG_X86_64 if (raid_cpu_has_avx2()) { SPEED_START { - /* ensure to use same hardware in the delta step */ - raid_gen_force(2, raid_gen2_avx2ext_raid); /* +2 to select R,S instead of Q,R */ raid_rec2_avx2ext(2, id, ip + 2, nd, size, v); } SPEED_STOP