[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-3c2e79f4cef7938125b356e7f5c8fd038212619a@git.kernel.org>
Date: Wed, 12 Jun 2019 05:29:05 -0700
From: tip-bot for Daniel Lezcano <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, daniel.lezcano@...aro.org,
tglx@...utronix.de, mingo@...nel.org, hpa@...or.com
Subject: [tip:irq/core] genirq/timings: Optimize the period detection speed
Commit-ID: 3c2e79f4cef7938125b356e7f5c8fd038212619a
Gitweb: https://git.kernel.org/tip/3c2e79f4cef7938125b356e7f5c8fd038212619a
Author: Daniel Lezcano <daniel.lezcano@...aro.org>
AuthorDate: Mon, 27 May 2019 22:55:16 +0200
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Wed, 12 Jun 2019 10:47:03 +0200
genirq/timings: Optimize the period detection speed
With a minimal period and if there is a period which is a multiple of it
but lesser than the max period then it will be detected before and the
minimal period will be never reached.
1 2 1 2 1 2 1 2 1 2 1 2
<-----> <-----> <----->
<-> <-> <-> <-> <-> <->
In that case, the minimum period is 2 and the maximum period is 5. That
means all repeating pattern of 2 will be detected as repeating pattern of
4, it is pointless to go up to 2 when searching for the period as it will
always fail.
Remove one loop iteration by increasing the minimal period to 3.
Signed-off-by: Daniel Lezcano <daniel.lezcano@...aro.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: andriy.shevchenko@...ux.intel.com
Link: https://lkml.kernel.org/r/20190527205521.12091-4-daniel.lezcano@linaro.org
---
kernel/irq/timings.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/irq/timings.c b/kernel/irq/timings.c
index 19d2fad379ee..1d1c411d4cae 100644
--- a/kernel/irq/timings.c
+++ b/kernel/irq/timings.c
@@ -261,7 +261,7 @@ void irq_timings_disable(void)
#define EMA_ALPHA_VAL 64
#define EMA_ALPHA_SHIFT 7
-#define PREDICTION_PERIOD_MIN 2
+#define PREDICTION_PERIOD_MIN 3
#define PREDICTION_PERIOD_MAX 5
#define PREDICTION_FACTOR 4
#define PREDICTION_MAX 10 /* 2 ^ PREDICTION_MAX useconds */
Powered by blists - more mailing lists