[bionic/linux-gcp][PATCH 0/2] linux-gcp: Reduce boot latency due to RAID6_PQ

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[bionic/linux-gcp][PATCH 0/2] linux-gcp: Reduce boot latency due to RAID6_PQ

Marcelo Henrique Cerri
BugLink: http://bugs.launchpad.net/bugs/1812728

RAID6_PQ tests several algorithms in other to pick the fastest option, but it
performs this test weather the system is using RAID6 or not. Unfortunately
several other modules and file systems have a hard dependency on RAID6_PQ.

In other to workaround this restriction, this patchset adds a kernel cmdline
option to pick a default algorithm, skipping the performace tests.

That approach might cause some performance hit in RAID6 users (although GCP
reports that this is not common), but will reduce boot time and it can be
reverted to the original behaviour via a cmdline option.

I also proposed that we work with upstream to delay this algorithm performance
test until RAID6 is really required during the boot (eventually never being
needed). However that is a solution that would require more time to be
discussed, implemented and tested.

Marcelo Henrique Cerri (2):
  UBUNTU: SAUCE: raid6: Add option for default PQ algorithm
  UBUNTU: [config] linux-gcp: CONFIG_RAID6_PQ_DEFAULT_ALG="avx2x4"

 debian.gcp/config/config.common.ubuntu |  2 ++
 lib/Kconfig                            | 17 +++++++++++++++++
 lib/raid6/algos.c                      | 26 ++++++++++++++++++++++++++
 3 files changed, 45 insertions(+)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[bionic/linux-gcp][PATCH 1/2] UBUNTU: SAUCE: raid6: Add option for default PQ algorithm

Marcelo Henrique Cerri
BugLink: http://bugs.launchpad.net/bugs/1812728

Add a new config ("CONFIG_RAID6_PQ_DEFAULT_ALG_BOOL") to enable
specifying a default gen() algorithm for RAID_PQ via the kernel
"raid6_pq_default_alg" cmdline option. When a default algorithm is
given, the raid6_pq module will skip the performance round of tests.

The config CONFIG_RAID6_PQ_DEFAULT_ALG can be used to define a default
value for the kernel option.

Signed-off-by: Marcelo Henrique Cerri <[hidden email]>
---
 lib/Kconfig       | 17 +++++++++++++++++
 lib/raid6/algos.c | 26 ++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/lib/Kconfig b/lib/Kconfig
index fb70e0f51752..c911d06afbb0 100644
--- 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) */
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[bionic/linux-gcp][PATCH 2/2] UBUNTU: [config] linux-gcp: CONFIG_RAID6_PQ_DEFAULT_ALG="avx2x4"

Marcelo Henrique Cerri
In reply to this post by Marcelo Henrique Cerri
BugLink: http://bugs.launchpad.net/bugs/1812728

Signed-off-by: Marcelo Henrique Cerri <[hidden email]>
---
 debian.gcp/config/config.common.ubuntu | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/debian.gcp/config/config.common.ubuntu b/debian.gcp/config/config.common.ubuntu
index 0ac0d1589569..3b548a3a1bde 100644
--- a/debian.gcp/config/config.common.ubuntu
+++ b/debian.gcp/config/config.common.ubuntu
@@ -5418,6 +5418,8 @@ CONFIG_RADIO_WL1273=m
 CONFIG_RADIO_WL128X=m
 CONFIG_RADIX_TREE_MULTIORDER=y
 CONFIG_RAID6_PQ=m
+CONFIG_RAID6_PQ_DEFAULT_ALG="avx2x4"
+CONFIG_RAID6_PQ_DEFAULT_ALG_BOOL=y
 CONFIG_RAID_ATTRS=m
 # CONFIG_RANDOM32_SELFTEST is not set
 CONFIG_RANDOMIZE_BASE=y
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [bionic/linux-gcp][PATCH 0/2] linux-gcp: Reduce boot latency due to RAID6_PQ

Thadeu Lima de Souza Cascardo-3
In reply to this post by Marcelo Henrique Cerri
On Mon, Jan 21, 2019 at 04:55:29PM -0200, Marcelo Henrique Cerri wrote:

> BugLink: http://bugs.launchpad.net/bugs/1812728
>
> RAID6_PQ tests several algorithms in other to pick the fastest option, but it
> performs this test weather the system is using RAID6 or not. Unfortunately
> several other modules and file systems have a hard dependency on RAID6_PQ.
>
> In other to workaround this restriction, this patchset adds a kernel cmdline
> option to pick a default algorithm, skipping the performace tests.
>
> That approach might cause some performance hit in RAID6 users (although GCP
> reports that this is not common), but will reduce boot time and it can be
> reverted to the original behaviour via a cmdline option.
>
> I also proposed that we work with upstream to delay this algorithm performance
> test until RAID6 is really required during the boot (eventually never being
> needed). However that is a solution that would require more time to be
> discussed, implemented and tested.
>
> Marcelo Henrique Cerri (2):
>   UBUNTU: SAUCE: raid6: Add option for default PQ algorithm
>   UBUNTU: [config] linux-gcp: CONFIG_RAID6_PQ_DEFAULT_ALG="avx2x4"
>
>  debian.gcp/config/config.common.ubuntu |  2 ++
>  lib/Kconfig                            | 17 +++++++++++++++++
>  lib/raid6/algos.c                      | 26 ++++++++++++++++++++++++++
>  3 files changed, 45 insertions(+)
>
> --
> 2.17.1

While I would rather see something that goes upstream, as this is only applied
to GCP (for now), I am happy with the approach taken.

Acked-by: Thadeu Lima de Souza Cascardo <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [bionic/linux-gcp][PATCH 0/2] linux-gcp: Reduce boot latency due to RAID6_PQ

Kleber Souza
In reply to this post by Marcelo Henrique Cerri
On 1/21/19 7:55 PM, Marcelo Henrique Cerri wrote:

> BugLink: http://bugs.launchpad.net/bugs/1812728
>
> RAID6_PQ tests several algorithms in other to pick the fastest option, but it
> performs this test weather the system is using RAID6 or not. Unfortunately
> several other modules and file systems have a hard dependency on RAID6_PQ.
>
> In other to workaround this restriction, this patchset adds a kernel cmdline
> option to pick a default algorithm, skipping the performace tests.
>
> That approach might cause some performance hit in RAID6 users (although GCP
> reports that this is not common), but will reduce boot time and it can be
> reverted to the original behaviour via a cmdline option.
>
> I also proposed that we work with upstream to delay this algorithm performance
> test until RAID6 is really required during the boot (eventually never being
> needed). However that is a solution that would require more time to be
> discussed, implemented and tested.
>
> Marcelo Henrique Cerri (2):
>   UBUNTU: SAUCE: raid6: Add option for default PQ algorithm
>   UBUNTU: [config] linux-gcp: CONFIG_RAID6_PQ_DEFAULT_ALG="avx2x4"
>
>  debian.gcp/config/config.common.ubuntu |  2 ++
>  lib/Kconfig                            | 17 +++++++++++++++++
>  lib/raid6/algos.c                      | 26 ++++++++++++++++++++++++++
>  3 files changed, 45 insertions(+)
>

Acked-by: Kleber Sacilotto de Souza <[hidden email]>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED: [bionic/linux-gcp][PATCH 0/2] linux-gcp: Reduce boot latency due to RAID6_PQ

Khaled Elmously
In reply to this post by Marcelo Henrique Cerri
On 2019-01-21 16:55:29 , Marcelo Henrique Cerri wrote:

> BugLink: http://bugs.launchpad.net/bugs/1812728
>
> RAID6_PQ tests several algorithms in other to pick the fastest option, but it
> performs this test weather the system is using RAID6 or not. Unfortunately
> several other modules and file systems have a hard dependency on RAID6_PQ.
>
> In other to workaround this restriction, this patchset adds a kernel cmdline
> option to pick a default algorithm, skipping the performace tests.
>
> That approach might cause some performance hit in RAID6 users (although GCP
> reports that this is not common), but will reduce boot time and it can be
> reverted to the original behaviour via a cmdline option.
>
> I also proposed that we work with upstream to delay this algorithm performance
> test until RAID6 is really required during the boot (eventually never being
> needed). However that is a solution that would require more time to be
> discussed, implemented and tested.
>
> Marcelo Henrique Cerri (2):
>   UBUNTU: SAUCE: raid6: Add option for default PQ algorithm
>   UBUNTU: [config] linux-gcp: CONFIG_RAID6_PQ_DEFAULT_ALG="avx2x4"
>
>  debian.gcp/config/config.common.ubuntu |  2 ++
>  lib/Kconfig                            | 17 +++++++++++++++++
>  lib/raid6/algos.c                      | 26 ++++++++++++++++++++++++++
>  3 files changed, 45 insertions(+)
>
> --
> 2.17.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team