]> git.ipfire.org Git - people/arne_f/kernel.git/commit
genirq/timings: Add array suffix computation code
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 28 Mar 2019 15:13:36 +0000 (16:13 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 5 Apr 2019 20:51:29 +0000 (22:51 +0200)
commitbbba0e7c5cdadb47a91edea1d5cd0caadbbb016f
tree18df2204805ddb0ef0d6972cab6b1f2607c2867c
parentbfe83844987a52dc1f71f757b60523811502dc93
genirq/timings: Add array suffix computation code

The previous approach based on the variance was discarding values from
the timings when they were considered as anomalies as stated by the
normal law statistical model.

However in the interrupt life, there can be multiple anomalies due to the
nature of the device generating the interrupts, and most of the time a
repeating pattern can be observed, that is particulary true for network,
console, MMC or SSD devices.

The variance approach missed the patterns and it was only able to deal with
the interrupt coming in regular intervals, thus reducing considerably the
scope of what is predictable.

In order to find out the repeating patterns, the interrupt intervals are
grouped in a ilog2 basis to create a suite of numbers with small
amplitude. Every group contains an exponential moving average of the values
belonging to the group. The array suffix, a data structure used for string
searching, data compression, etc ..., is built from the suite of numbers
and the suffixes are then searched in this suite.

The tests showed the algorithm is able to find all repeating patterns,
as well as regular interval in less than 1us on x86-i7.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: rjw@rjwysocki.net
Cc: ulf.hansson@linaro.org
Cc: linux-pm@vger.kernel.org
Link: https://lkml.kernel.org/r/20190328151336.5316-2-daniel.lezcano@linaro.org
kernel/irq/timings.c