From f0dcd127b4da500ca99db66a63baffbe1360c53e Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 27 Jun 2011 09:17:13 +1000 Subject: [PATCH] Show which cpu mining thread when giving affinity message. --- cpu-miner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu-miner.c b/cpu-miner.c index b55906a5..8fe545bf 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -59,7 +59,7 @@ static inline void affine_to_cpu(int id, int cpu) CPU_ZERO(&set); CPU_SET(cpu, &set); sched_setaffinity(0, sizeof(&set), &set); - applog(LOG_INFO, "Binding thread %d to cpu %d", id, cpu); + applog(LOG_INFO, "Binding cpu mining thread %d to cpu %d", id, cpu); } #else static inline void drop_policy(void) @@ -735,7 +735,7 @@ static void *miner_thread(void *userdata) /* Cpu affinity only makes sense if the number of threads is a multiple * of the number of CPUs */ if (!(opt_n_threads % num_processors)) - affine_to_cpu(cpu_from_thr_id(thr_id), thr_id % num_processors); + affine_to_cpu(thr_id - gpu_threads, cpu_from_thr_id(thr_id)); while (1) { struct work work __attribute__((aligned(128)));