Re: Slowdown due to threads bouncing between HT cores

From: Andi Kleen
Date: Sat Oct 04 2014 - 09:41:20 EST


"Steinar H. Gunderson" <sgunderson@xxxxxxxxxxx> writes:
>
> So, benchmark:
>
> - Default: 13266 kN/sec
> - Change from ondemand to performance on all cores: 14600 kN/sec
> - taskset -c 0-19 (locking affinity to only one set of hyperthreads):
> 17512 kN/sec

iirc the main reasons for unbound threads migrating away are:

- something else gets scheduled on these logical CPUs, so
the scheduler tries to balance to run queue lengths

You could check that with perf timechart or perf sched record/map
or kernelshark.

- there is some IO or communication which causes wakeup affinity.

You could try disabling WAKEUP_PREEMPTION or NEXT_BUDDY in
/sys/kernel/debug/sched_features

-Andi
--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/