From e731f3e28b7e7d1c745b03084e01036ee00018eb Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 12 Nov 2018 15:22:16 -0800 Subject: lib/raid6: add missing include for raid6test Add #include for gettimeofday() to fix the compiler warning about an implicitly defined functions. Signed-off-by: Daniel Verkamp Signed-off-by: Shaohua Li --- include/linux/raid/pq.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h index ea8505204fdf..0c245dcb8b48 100644 --- a/include/linux/raid/pq.h +++ b/include/linux/raid/pq.h @@ -35,6 +35,7 @@ extern const char raid6_empty_zero_page[PAGE_SIZE]; #include #include #include +#include #include /* Not standard, but glibc defines it */ -- cgit v1.2.3 From 58af3110a7c5d161f72f94a98c6f2b9b75bf5cf9 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 12 Nov 2018 15:22:17 -0800 Subject: lib/raid6: avoid __attribute_const__ redefinition This is defined in glibc's sys/cdefs.h on my system with the same definition as the raid6test fallback definition. Add a #ifndef check to avoid a compiler warning about redefining it. Signed-off-by: Daniel Verkamp Signed-off-by: Shaohua Li --- include/linux/raid/pq.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h index 0c245dcb8b48..d7c99161bba2 100644 --- a/include/linux/raid/pq.h +++ b/include/linux/raid/pq.h @@ -53,7 +53,9 @@ extern const char raid6_empty_zero_page[PAGE_SIZE]; #define __init #define __exit -#define __attribute_const__ __attribute__((const)) +#ifndef __attribute_const__ +# define __attribute_const__ __attribute__((const)) +#endif #define noinline __attribute__((noinline)) #define preempt_enable() -- cgit v1.2.3 From be85f93ae2df32dea0b20908316f1d894c3e0f64 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 12 Nov 2018 15:26:52 -0800 Subject: lib/raid6: add option to skip algo benchmarking This is helpful for systems where fast startup time is important. It is especially nice to avoid benchmarking RAID functions that are never used (for example, BTRFS selects RAID6_PQ even if the parity RAID mode is not in use). This saves 250+ milliseconds of boot time on modern x86 and ARM systems with a dozen or more available implementations. The new option is defaulted to 'y' to match the previous behavior of always benchmarking on init. Signed-off-by: Daniel Verkamp Signed-off-by: Shaohua Li --- include/linux/raid/pq.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h index d7c99161bba2..605cf46c17bd 100644 --- a/include/linux/raid/pq.h +++ b/include/linux/raid/pq.h @@ -70,6 +70,9 @@ extern const char raid6_empty_zero_page[PAGE_SIZE]; #define MODULE_DESCRIPTION(desc) #define subsys_initcall(x) #define module_exit(x) + +#define IS_ENABLED(x) (x) +#define CONFIG_RAID6_PQ_BENCHMARK 1 #endif /* __KERNEL__ */ /* Routine choices */ -- cgit v1.2.3