summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-09-19 09:39:35 -0500
committerDerek Foreman <derekf@osg.samsung.com>2016-09-19 09:40:43 -0500
commit541b72dcb2aa7a0a09c6b57603da2800d8caac01 (patch)
tree8c1c37b4fd37d8b6d2af841cb90f5492feffde17 /src
parent2569a8c880773c64857d2e627fafa0daa9a0d47a (diff)
render_thread: Attempt to set affinity to a random fast core
We've been pinning the render thread for every EFL process to core 0. This is a bit silly in the first place, but some big.LITTLE arm systems, such as exynos 5422, have the LITTLE cores first. On those systems we put all the render threads on a slow core. This attempts to fix that by using a random core from the pool of fast cores. If we can't determine which cores are fast (ie: we're not on a linux kernel with cpufreq enabled) then we'll continue doing what we've always done - pin to core 0.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/common/evas_thread_render.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/evas/common/evas_thread_render.c b/src/lib/evas/common/evas_thread_render.c
index 623e40e4f4..3489c5ad08 100644
--- a/src/lib/evas/common/evas_thread_render.c
+++ b/src/lib/evas/common/evas_thread_render.c
@@ -1,4 +1,5 @@
1#include "evas_common_private.h" 1#include "evas_common_private.h"
2#include "eina_cpu_private.h"
2 3
3#include <assert.h> 4#include <assert.h>
4 5
@@ -125,6 +126,7 @@ out:
125void 126void
126evas_thread_init(void) 127evas_thread_init(void)
127{ 128{
129 int core;
128 if (init_count++) return; 130 if (init_count++) return;
129 131
130 eina_threads_init(); 132 eina_threads_init();
@@ -135,7 +137,13 @@ evas_thread_init(void)
135 CRI("Could not create draw thread lock"); 137 CRI("Could not create draw thread lock");
136 if (!eina_condition_new(&evas_thread_queue_condition, &evas_thread_queue_lock)) 138 if (!eina_condition_new(&evas_thread_queue_condition, &evas_thread_queue_lock))
137 CRI("Could not create draw thread condition"); 139 CRI("Could not create draw thread condition");
138 if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, 0, 140
141 core = _eina_cpu_fast_core_get();
142 /* Keep previous behaviour of pinning to core 0 if finding a fast
143 * core fails.
144 */
145 if (core < 0) core = 0;
146 if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, core,
139 evas_thread_worker_func, NULL)) 147 evas_thread_worker_func, NULL))
140 if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, -1, 148 if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, -1,
141 evas_thread_worker_func, NULL)) 149 evas_thread_worker_func, NULL))