Do not log per-thread CPU affinity in quiet mode
This commit is contained in:
parent
092c3fc196
commit
236e338463
1 changed files with 6 additions and 4 deletions
10
cpu-miner.c
10
cpu-miner.c
|
@ -63,7 +63,6 @@ static inline void affine_to_cpu(int id, int cpu)
|
||||||
CPU_ZERO(&set);
|
CPU_ZERO(&set);
|
||||||
CPU_SET(cpu, &set);
|
CPU_SET(cpu, &set);
|
||||||
sched_setaffinity(0, sizeof(&set), &set);
|
sched_setaffinity(0, sizeof(&set), &set);
|
||||||
applog(LOG_INFO, "Binding thread %d to cpu %d", id, cpu);
|
|
||||||
}
|
}
|
||||||
#elif defined(__FreeBSD__) /* FreeBSD specific policy and affinity management */
|
#elif defined(__FreeBSD__) /* FreeBSD specific policy and affinity management */
|
||||||
#include <sys/cpuset.h>
|
#include <sys/cpuset.h>
|
||||||
|
@ -77,7 +76,6 @@ static inline void affine_to_cpu(int id, int cpu)
|
||||||
CPU_ZERO(&set);
|
CPU_ZERO(&set);
|
||||||
CPU_SET(cpu, &set);
|
CPU_SET(cpu, &set);
|
||||||
cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_CPUSET, -1, sizeof(cpuset_t), &set);
|
cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_CPUSET, -1, sizeof(cpuset_t), &set);
|
||||||
applog(LOG_INFO, "Binding thread %d to cpu %d", id, cpu);
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline void drop_policy(void)
|
static inline void drop_policy(void)
|
||||||
|
@ -685,8 +683,12 @@ static void *miner_thread(void *userdata)
|
||||||
|
|
||||||
/* Cpu affinity only makes sense if the number of threads is a multiple
|
/* Cpu affinity only makes sense if the number of threads is a multiple
|
||||||
* of the number of CPUs */
|
* of the number of CPUs */
|
||||||
if (num_processors > 1 && opt_n_threads % num_processors == 0)
|
if (num_processors > 1 && opt_n_threads % num_processors == 0) {
|
||||||
affine_to_cpu(mythr->id, mythr->id % num_processors);
|
if (!opt_quiet)
|
||||||
|
applog(LOG_INFO, "Binding thread %d to cpu %d",
|
||||||
|
thr_id, thr_id % num_processors);
|
||||||
|
affine_to_cpu(thr_id, thr_id % num_processors);
|
||||||
|
}
|
||||||
|
|
||||||
if (opt_algo == ALGO_SCRYPT)
|
if (opt_algo == ALGO_SCRYPT)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue