diff options
author | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2019-02-16 02:14:15 -0800 |
---|---|---|
committer | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2019-02-16 02:14:15 -0800 |
commit | aa7e63abe228441a103b72bd491adc94f3ec9854 (patch) | |
tree | bab5ebaaa31545f112544d6c267f7789ce96e132 | |
parent | Updated to 4.20.10 (diff) | |
download | linux-aa7e63abe228441a103b72bd491adc94f3ec9854.tar.xz |
Added raid6 preselected algorithm patch.
Anyone that uses raid6 and has avx2 should change it to avx2x4.
-rw-r--r-- | PKGBUILD | 11 | ||||
-rw-r--r-- | config.x86_64 | 2 | ||||
-rw-r--r-- | raid6-default-algo.patch | 70 |
3 files changed, 81 insertions, 2 deletions
@@ -6,7 +6,7 @@ # # I maintain this because: # Arch version patch script does not apply consistently -# Arch version lacks ath9k and greysky2 patches +# Arch version lacks ath9k, greysky2, and raid6 patches # Arch version allows SM3 and SM4 # Arch version is 300 Hz # Arch version supports Intel ME @@ -31,6 +31,7 @@ source=(https://www.kernel.org/pub/linux/kernel/v4.x/linux-${pkgver}.tar.xz https://www.kernel.org/pub/linux/kernel/v4.x/linux-${pkgver}.tar.sign enable_additional_cpu_optimizations-$_gcc_more_v.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/$_gcc_more_v.tar.gz ath9k-regdom-hack.patch + raid6-default-algo.patch config.x86_64 # the main kernel config files 60-linux.hook # pacman hook for depmod 90-linux.hook # pacman hook for initramfs regeneration @@ -40,7 +41,8 @@ sha256sums=('53de6be9adfb8899f0a15855f1aef62b8b5a3c5c575196ec8a640a5b8c1c3cf8' 'SKIP' '226e30068ea0fecdb22f337391385701996bfbdba37cdcf0f1dbf55f1080542d' 'e7ebf050c22bcec0028c0b3c79fd6d3913b0370ecc6a23dfe78ce475630cf503' - '0de5efb4e997d0aeb7c4a16997da39100e91a7e335ac00b2d7d951bc675fe538' + '0f81d6e4158b7beeb0eb514f1b9401f7e23699cb0f7b0d513e25dae1815daaeb' + '77bd79791cbfc91d4e62a77245e7e784e6978cbadb4450cb1a611a68944b84aa' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65') @@ -70,6 +72,10 @@ prepare() { msg2 "Applying ath9k patch" patch -p1 -i ../ath9k-regdom-hack.patch + # Set default raid6 algo patch + msg " Applying raid6 patch" + patch -p1 -i ../raid6-default-algo.patch + msg2 "Setting version..." scripts/setlocalversion --save-scmversion @@ -84,6 +90,7 @@ prepare() { #else cp ../config.x86_64 .config #fi + make olddefconfig make menuconfig diff --git a/config.x86_64 b/config.x86_64 index 8bbd317..240ebb2 100644 --- a/config.x86_64 +++ b/config.x86_64 @@ -9499,6 +9499,8 @@ CONFIG_BINARY_PRINTF=y # Library routines # CONFIG_RAID6_PQ=m +CONFIG_RAID6_PQ_DEFAULT_ALG_BOOL=y +CONFIG_RAID6_PQ_DEFAULT_ALG="sse2x4" CONFIG_BITREVERSE=y CONFIG_RATIONAL=y CONFIG_GENERIC_STRNCPY_FROM_USER=y diff --git a/raid6-default-algo.patch b/raid6-default-algo.patch new file mode 100644 index 0000000..98bfd54 --- /dev/null +++ b/raid6-default-algo.patch @@ -0,0 +1,70 @@ +--- a/lib/Kconfig ++++ b/lib/Kconfig +@@ -10,6 +10,23 @@ menu "Library routines" + config RAID6_PQ + tristate + ++config RAID6_PQ_DEFAULT_ALG_BOOL ++ bool "Default RAID6 PQ algorithm" ++ default n ++ depends on RAID6_PQ ++ help ++ Allow for specifying a default algorithm via the kernel ++ parameter "raid6_pq_default_alg", which forces the performance ++ tests to be skipped. This can save between 500ms to 2s ++ during boot. ++ ++config RAID6_PQ_DEFAULT_ALG ++ string "Default RAID6 PQ algorithm name" ++ default "" ++ depends on RAID6_PQ_DEFAULT_ALG_BOOL ++ help ++ The default algorithm name to be used by default. ++ + config BITREVERSE + tristate + +diff --git a/lib/raid6/algos.c b/lib/raid6/algos.c +index d3b16f43c39f..480cbfbe293f 100644 +--- a/lib/raid6/algos.c ++++ b/lib/raid6/algos.c +@@ -30,6 +30,12 @@ EXPORT_SYMBOL(raid6_empty_zero_page); + #endif + #endif + ++#ifdef CONFIG_RAID6_PQ_DEFAULT_ALG_BOOL ++static char raid6_pq_default_alg[32] = CONFIG_RAID6_PQ_DEFAULT_ALG; ++module_param_string(raid6_pq_default_alg, raid6_pq_default_alg, sizeof(raid6_pq_default_alg), 0444); ++MODULE_PARM_DESC(raid6_pq_default_alg, "Default gen/xor() algorithm"); ++#endif ++ + struct raid6_calls raid6_call; + EXPORT_SYMBOL_GPL(raid6_call); + +@@ -157,6 +163,26 @@ static inline const struct raid6_calls *raid6_choose_gen( + const struct raid6_calls *const *algo; + const struct raid6_calls *best; + ++#ifdef CONFIG_RAID6_PQ_DEFAULT_ALG_BOOL ++ if (strlen(raid6_pq_default_alg)) { ++ for (algo = raid6_algos; *algo; algo++) { ++ if (!strncmp(raid6_pq_default_alg, (*algo)->name, sizeof(raid6_pq_default_alg))) { ++ if ((*algo)->valid && !(*algo)->valid()) { ++ pr_info("raid6: default alg \"%s\" is invalid.\n", ++ raid6_pq_default_alg); ++ continue; ++ } ++ pr_info("raid6: using default algorithm %s gen() without performace tests.\n", ++ (*algo)->name); ++ raid6_call = **algo; ++ return *algo; ++ } ++ } ++ pr_info("raid6: default alg \"%s\" not found. Choosing the best alg as fallback...\n", ++ raid6_pq_default_alg); ++ } ++#endif ++ + for (bestgenperf = 0, bestxorperf = 0, best = NULL, algo = raid6_algos; *algo; algo++) { + if (!best || (*algo)->prefer >= best->prefer) { + /* 2 ^ (RAID6_TIME_JIFFIES_LG2 - 0.5) */ |