]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
UBUNTU: SAUCE: md/raid6 algorithms: scale test duration for speedier boots
authorColin Ian King <colin.king@canonical.com>
Mon, 6 Feb 2017 15:21:31 +0000 (15:21 +0000)
committerSeth Forshee <seth.forshee@canonical.com>
Tue, 5 Sep 2017 12:33:31 +0000 (07:33 -0500)
commitec424413171fd60a8b3cd14fad14a4d0fdb1490a
treecc55844805fb97a254e097e23247c50f5b5a33f0
parent36b4777f5f8ae8721ba8199096e6af6a0dbd73dc
UBUNTU: SAUCE: md/raid6 algorithms: scale test duration for speedier boots

The original code runs for a set run time based on 2^RAID6_TIME_JIFFIES_LG2.
The default kernel value for RAID6_TIME_JIFFIES_LG2 is 4, however, emperical
testing shows that a value of 3.5 is the sweet spot for getting consistent
benchmarking results and speeding up the run time of the benchmarking.

To achieve 2^3.5 we use the following:
   2^3.5 = 2^4 / 2^0.5
         = 2^4 / sqrt(2)
         = 2^4 * 0.707106781

Too keep this as integer math that is as accurate as required and avoiding
overflow, this becomes:
         = 2^4 * 181 / 256
         = (2^4 * 181) >> 8

We also need to scale down perf by the same factor, however, to
get a good approximate integer result without an overflow we scale
by 2^4.0 * sqrt(2) =
         = 2 ^ 4 * 1.41421356237
         = 2 ^ 4 * 1448 / 1024
         = (2 ^ 4 * 1448) >> 10

This has been tested on 2 AWS instances, a small t2 and a medium m3
with 30 boot tests each and compared to the same instances booted 30
times on an umodified kernel. In all results, we get the same
algorithms being selected and a 100% consistent result over the 30
boots, showing that this optimised jiffy timing scaling does not break
the original functionality.

On the t2.small we see a saving of ~0.126 seconds and t3.medium a saving of
~0.177 seconds.

Tested on a 4 CPU VM on an 8 thread Xeon server; seeing a saving of ~0.33
seconds (average over 10 boots).

Tested on a 8 thread Xeon server, seeing a saving of ~1.24 seconds (average
of 10 boots).

The testing included double checking the algorithm chosen by the optimized
selection and seeing the same as pre-optimised version.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
lib/raid6/algos.c