derekf pushed a commit to branch master.

commit 0f98e1c6d324a7d17b6e7bdb7b1b41d3a2db9954
Author: Derek Foreman <>
Date:   Thu Sep 15 16:09:00 2016 -0500

    eina_thread: Don't ensure affinity core is lower than number of cpus
    CPUs can be turned off after boot leading to a sparse mapping of core ids.
    For example, if I turn off the first four cores on an exynos 5422 (these
    are the low speed cores) then the high speed cores are still numbered 4-7
    but there are only 4 cores present.
    In that situation using affinity_core % num_cpus will prevent ever being
    able to set affinity at all.
    Just remove the pointless check and let the user set whatever core id they
 src/lib/eina/eina_thread.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/lib/eina/eina_thread.c b/src/lib/eina/eina_thread.c
index 5002a42..f698092 100644
--- a/src/lib/eina/eina_thread.c
+++ b/src/lib/eina/eina_thread.c
@@ -70,12 +70,9 @@ _eina_thread_create(Eina_Thread *t, int affinity, void 
*(*func)(void *data), voi
         cpu_set_t cpu;
-        int cpunum;
-        cpunum = eina_cpu_count();
-        CPU_SET(affinity % cpunum, &cpu);
+        CPU_SET(affinity, &cpu);
         pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu);


Reply via email to