aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp_timer_internal.h
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2018-10-17 13:29:42 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-10-24 17:22:39 +0300
commit4aa40267ae25e6ee021c8ce067bae649db2d0d8d (patch)
tree606e5f973f0f1a2baa148674454f2f336f1ccbff /platform/linux-generic/include/odp_timer_internal.h
parent83e9a6c3896d2d8a949a7bece565bae7dfd1d967 (diff)
linux-gen: timer: reduce inline timer overhead
Reduce inline timer overhead by not polling timers until at least one timer pool has been created. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> 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.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/platform/linux-generic/include/odp_timer_internal.h b/platform/linux-generic/include/odp_timer_internal.h
index 8dda9e6ff..02ba92e0d 100644
--- a/platform/linux-generic/include/odp_timer_internal.h
+++ b/platform/linux-generic/include/odp_timer_internal.h
@@ -19,6 +19,7 @@
#include <odp_buffer_internal.h>
#include <odp_pool_internal.h>
#include <odp/api/timer.h>
+#include <odp_global_data.h>
/* Minimum number of scheduling rounds between checking timer pools. */
#define CONFIG_TIMER_RUN_RATELIMIT_ROUNDS 1
@@ -38,22 +39,12 @@ 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;
+ return odp_global_rw->inline_timers ? _timer_run() : 0;
}
#endif