aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp_timer_internal.h
diff options
context:
space:
mode:
authorBrian Brooks <brian.brooks@arm.com>2017-06-14 14:34:50 -0500
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-12-27 21:58:42 +0300
commit4fe8cc16bd453c47247ad89eb8c2679f14f456a9 (patch)
tree933ec0948b1da70e8601ea5d324dc0f017f8b0f9 /platform/linux-generic/include/odp_timer_internal.h
parent96bba0c6eb7b712122049307873153bb24816be6 (diff)
timer: allow timer processing to run on worker cores
Run timer pool processing on worker cores if the application hints that the scheduler will be used. This reduces the latency and jitter of the point at which timer pool processing begins. See [1] for details. [1] https://docs.google.com/document/d/1sY7rOxqCNu-bMqjBiT5_keAIohrX1ZW-eL0oGLAQ4OM/edit?usp=sharing Signed-off-by: Brian Brooks <brian.brooks@arm.com> Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/include/odp_timer_internal.h')
-rw-r--r--platform/linux-generic/include/odp_timer_internal.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/platform/linux-generic/include/odp_timer_internal.h b/platform/linux-generic/include/odp_timer_internal.h
index 91b12c545..67ee9feff 100644
--- a/platform/linux-generic/include/odp_timer_internal.h
+++ b/platform/linux-generic/include/odp_timer_internal.h
@@ -20,6 +20,12 @@
#include <odp_pool_internal.h>
#include <odp/api/timer.h>
+/* Minimum number of nanoseconds between checking timer pools. */
+#define CONFIG_TIMER_RUN_RATELIMIT_NS 100
+
+/* Minimum number of scheduling rounds between checking timer pools. */
+#define CONFIG_TIMER_RUN_RATELIMIT_ROUNDS 1
+
/**
* Internal Timeout header
*/
@@ -35,4 +41,22 @@ typedef struct {
odp_timer_t timer;
} odp_timeout_hdr_t;
+/*
+ * Whether to run timer pool processing 'inline' (on worker cores) or in
+ * background threads (thread-per-timerpool).
+ *
+ * If the application will use both scheduler and timer this flag is set
+ * to true, otherwise false. This application conveys this information via
+ * the 'not_used' bits in odp_init_t which are passed to odp_global_init().
+ */
+extern odp_bool_t inline_timers;
+
+unsigned _timer_run(void);
+
+/* Static inline wrapper to minimize modification of schedulers. */
+static inline unsigned timer_run(void)
+{
+ return inline_timers ? _timer_run() : 0;
+}
+
#endif