Re: sched: tweak select_idle_sibling to look for idle threads
From: Peter Zijlstra
Date: Tue May 03 2016 - 14:22:23 EST
On Tue, May 03, 2016 at 01:31:31PM +0200, Peter Zijlstra wrote:
> Then flip on the last_idle tracking in select_idle_core():
>
> root@ivb-ep:~/bench/sysbench# for i in NO_OLD_IDLE NO_ORDER_IDLE IDLE_CORE NO_FORCE_CORE IDLE IDLE_SMT IDLE_LAST NO_IDLE_FIRST ; do echo $i > /debug/sched_features ; done ; ./doit-psql 30 2 5 10 20 40 80
> 2: [30 secs] transactions: 54355 (1811.78 per sec.)
> 5: [30 secs] transactions: 122609 (4086.81 per sec.)
> 10: [30 secs] transactions: 238738 (7957.66 per sec.)
> 20: [30 secs] transactions: 354693 (11822.49 per sec.)
> 40: [30 secs] transactions: 421807 (14059.32 per sec.)
> 80: [30 secs] transactions: 427088 (14234.25 per sec.)
>
>
> And see the top end collapse..
> + if (sched_feat(IDLE_CORE)) {
> + if (test_idle_cores(target)) {
> + i = select_idle_core(p, start);
> + if ((unsigned)i < nr_cpumask_bits)
> + return i;
>
> /*
> + * Failed to find an idle core; stop looking for one.
> */
> + clear_idle_cores(target);
> + }
> }
'Obvious' bug there; if we start returning idle threads; we'll not get
to clear_idle_cores() and the thing remains active and badness happens.