]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: use cauchy if K and M values are not supported by ISA-L reed_sol_van
authorJamie Pryde <jamiepry@uk.ibm.com>
Wed, 13 Aug 2025 10:57:40 +0000 (11:57 +0100)
committerJamie Pryde <jamiepry@uk.ibm.com>
Wed, 13 Aug 2025 20:49:00 +0000 (21:49 +0100)
ISA-L supports a limited set of K and M values when using a vandermonde matrix. There are no such limitations when using a cauchy matrix. If the user specifies reed_sol_van (or does not specify a technique and relies on the default reed_sol_van setting) and an unsupported K/M combination, then we will automatically switch the technique for the new EC profile to cauchy. Benchmarking has not shown any noticeable performance differences between ISA-L in reed_sol_van vs cauchy modes.

Signed-off-by: Jamie Pryde <jamiepry@uk.ibm.com>
src/erasure-code/isa/ErasureCodeIsa.cc

index 78f955a3c5f368827c63416be5c8b5d4f64d3bdf..e1482111a0e2aebb10b965e3449993fa9ab1e973 100644 (file)
@@ -577,7 +577,7 @@ int ErasureCodeIsaDefault::parse(ErasureCodeProfile &profile,
     // benchmarktool and 10*(combinatoric for maximum loss) random
     // full erasures
     if (k > MAX_K) {
-      *ss << "Vandermonde: m=" << m
+      *ss << "Vandermonde: k=" << k
         << " should be less/equal than " << MAX_K
         << " : revert to k=" << MAX_K << std::endl;
       k = MAX_K;
@@ -587,18 +587,19 @@ int ErasureCodeIsaDefault::parse(ErasureCodeProfile &profile,
     if (m > 4) {
       *ss << "Vandermonde: m=" << m
         << " should be less than 5 to guarantee an MDS codec:"
-        << " revert to m=4" << std::endl;
-      m = 4;
-      err = -EINVAL;
+        << " switching to Cauchy technique" << std::endl;
+      matrixtype = kCauchy;
+      profile["technique"] = "cauchy"sv;
     }
     switch (m) {
     case 4:
       if (k > 21) {
         *ss << "Vandermonde: k=" << k
           << " should be less than 22 to guarantee an MDS"
-          << " codec with m=4: revert to k=21" << std::endl;
-        k = 21;
-        err = -EINVAL;
+          << " codec with m=4: switching"
+          << " to Cauchy technique" << std::endl;
+        matrixtype = kCauchy;
+        profile["technique"] = "cauchy"sv;
       }
       break;
     default: