diff options
author | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2019-02-16 02:19:04 -0800 |
---|---|---|
committer | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2019-02-16 02:19:04 -0800 |
commit | 72436519e5f831c449986b193cf8d30ccf3dea4e (patch) | |
tree | 3b5c292aac34ea2a9082e54bac96f6ccb1c95b49 | |
parent | Updated to 4.20.10.a (diff) | |
download | linux-libre-hardened-72436519e5f831c449986b193cf8d30ccf3dea4e.tar.xz |
Added raid6 preselected algorithm patch.
Anyone that uses raid6 and has avx2 should change it to avx2x4.
-rw-r--r-- | PKGBUILD | 10 | ||||
-rw-r--r-- | config.x86_64 | 2 | ||||
-rw-r--r-- | raid6-default-algo.patch | 70 |
3 files changed, 80 insertions, 2 deletions
@@ -7,7 +7,7 @@ # # I maintain this because: # Parabola version patch script does not apply consistently -# Parabola version lacks ath9k and greysky2 patches +# Parabola version lacks ath9k, greysky2, and raid6 patches # Parabola version allows SM3 and SM4 # Parabola version is 300 Hz # Parabola version supports Intel ME @@ -38,6 +38,7 @@ source=(https://linux-libre.fsfla.org/pub/linux-libre/releases/${_gnumajver}/lin https://github.com/anthraxx/linux-hardened/releases/download/${pkgver}/linux-hardened-${pkgver}.patch{,.sig} 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 @@ -51,7 +52,8 @@ sha256sums=('b80d5c0076dfa11ee8af63ad0b4795569d098b77020d2fffc797b892ba455a1f' 'SKIP' '226e30068ea0fecdb22f337391385701996bfbdba37cdcf0f1dbf55f1080542d' 'e7ebf050c22bcec0028c0b3c79fd6d3913b0370ecc6a23dfe78ce475630cf503' - 'ed8ddeb7b187e449a069bed26d033801f5c63b42b6a1aed6ad47d4cb67dc76ec' + '0f81d6e4158b7beeb0eb514f1b9401f7e23699cb0f7b0d513e25dae1815daaeb' + 'db6d1c11678b78eb242c9021b871587547ffd487cddde8a10471d884bcb7a1db' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65') @@ -86,6 +88,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..." sed -e "/^EXTRAVERSION =/s/=.*/= .${_hardenedver}/" -i Makefile diff --git a/config.x86_64 b/config.x86_64 index efb53f5..128556b 100644 --- a/config.x86_64 +++ b/config.x86_64 @@ -9495,6 +9495,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) */ |