Re: [PATCH RFC] locking/mutexes: don't spin on owner when wait list is not NULL.

From: Huang\, Ying
Date: Sun Jan 31 2016 - 22:35:51 EST


huang ying <huang.ying.caritas@xxxxxxxxx> writes:

> On Sat, Jan 30, 2016 at 9:18 AM, Ding Tianhong <dingtianhong@xxxxxxxxxx> wrote:
>> On 2016/1/29 17:53, Peter Zijlstra wrote:
>>> On Sun, Jan 24, 2016 at 04:03:50PM +0800, Ding Tianhong wrote:
>>>
>>>> looks good to me, I will try this solution and report the result, thanks everyone.
>>>
>>> Did you get a change to run with this?
>>>
>>> .
>>>
>>
>> I backport this patch to 3.10 lts kernel, and didn't change any
>> logic, Till now, the patch works fine to me, and no need to change
>> anything,
>> So I think this patch is no problem, could you formal release this patch to the latest kernel? :)
>>
>> Thanks.
>> Ding
>>
>>
>
> The original patch from Tianhong triggered a performance regression
> because the optimistic spinning is turned off in effect. I tested
> Peter's patch with same configuration and there show no regression.
> So I think the patch keep the optimistic spinning. Test result
> details will be in the next email.

Here is the detailed test result:

=========================================================================================
compiler/cpufreq_governor/kconfig/nr_task/rootfs/tbox_group/test/testcase:
gcc-4.9/performance/x86_64-rhel/100%/debian-x86_64-2015-02-07.cgz/lkp-ivb-d01/fstime/unixbench

commit:
v4.4
1db66c17114d5437c0757d6792c0d8923192ecd6

v4.4 1db66c17114d5437c0757d6792
---------------- --------------------------
%stddev %change %stddev
\ | \
371269 Â 10% -93.2% 25080 Â 4% unixbench.time.voluntary_context_switches
371269 Â 10% -93.2% 25080 Â 4% time.voluntary_context_switches
6189 Â 8% -76.4% 1463 Â 6% vmstat.system.cs
5706 Â 0% -1.7% 5608 Â 0% vmstat.system.in
113680 Â 12% -73.5% 30086 Â 1% cpuidle.C1-IVB.usage
1515925 Â 20% +68.3% 2552001 Â 11% cpuidle.C1E-IVB.time
1227221 Â 20% -51.7% 592695 Â 17% cpuidle.C3-IVB.time
2697 Â 10% -77.8% 598.33 Â 10% cpuidle.C3-IVB.usage
15173 Â 6% -23.1% 11663 Â 1% cpuidle.C6-IVB.usage
34.38 Â 27% -35.0% 22.33 Â 2% cpuidle.POLL.usage
61.92 Â 9% +14.3% 70.78 Â 7% sched_debug.cfs_rq:/.load_avg.min
40.85 Â 29% +27.3% 52.00 Â 10% sched_debug.cfs_rq:/.runnable_load_avg.2
-1949 Â-37% -64.6% -690.19 Â-134% sched_debug.cfs_rq:/.spread0.4
-1773 Â-29% -85.6% -256.00 Â-388% sched_debug.cfs_rq:/.spread0.7
-2478 Â-26% -49.5% -1251 Â-66% sched_debug.cfs_rq:/.spread0.min
61.95 Â 9% +14.8% 71.11 Â 7% sched_debug.cfs_rq:/.tg_load_avg_contrib.min
396962 Â 12% +27.9% 507573 Â 10% sched_debug.cpu.avg_idle.0
432973 Â 18% +45.3% 629147 Â 12% sched_debug.cpu.avg_idle.6
448566 Â 3% +11.5% 499990 Â 0% sched_debug.cpu.avg_idle.avg
45.31 Â 5% -9.5% 41.00 Â 3% sched_debug.cpu.cpu_load[3].7
52204 Â 10% -49.9% 26173 Â 34% sched_debug.cpu.nr_switches.0
50383 Â 12% -57.6% 21353 Â 15% sched_debug.cpu.nr_switches.1
45425 Â 16% -68.5% 14325 Â 28% sched_debug.cpu.nr_switches.2
43069 Â 20% -65.5% 14852 Â 41% sched_debug.cpu.nr_switches.3
40285 Â 16% -70.4% 11905 Â 47% sched_debug.cpu.nr_switches.4
40732 Â 13% -75.8% 9872 Â 39% sched_debug.cpu.nr_switches.5
43011 Â 19% -80.0% 8607 Â 42% sched_debug.cpu.nr_switches.6
38076 Â 12% -75.9% 9167 Â 40% sched_debug.cpu.nr_switches.7
44148 Â 7% -67.1% 14532 Â 6% sched_debug.cpu.nr_switches.avg
59877 Â 8% -51.3% 29146 Â 21% sched_debug.cpu.nr_switches.max
33672 Â 9% -83.0% 5718 Â 4% sched_debug.cpu.nr_switches.min
-0.62 Â-1411% -2212.5% 13.00 Â 16% sched_debug.cpu.nr_uninterruptible.0
-1.23 Â-582% -1318.8% 15.00 Â 35% sched_debug.cpu.nr_uninterruptible.1
2.54 Â263% +267.7% 9.33 Â 91% sched_debug.cpu.nr_uninterruptible.2
0.31 Â2966% -5841.7% -17.67 Â-19% sched_debug.cpu.nr_uninterruptible.5
9.84 Â 19% +70.4% 16.76 Â 5% sched_debug.cpu.nr_uninterruptible.stddev
116287 Â 4% -20.9% 91972 Â 9% sched_debug.cpu.sched_count.0
50411 Â 12% -57.6% 21382 Â 15% sched_debug.cpu.sched_count.1
45453 Â 16% -68.4% 14356 Â 28% sched_debug.cpu.sched_count.2
43098 Â 20% -65.5% 14888 Â 41% sched_debug.cpu.sched_count.3
40314 Â 16% -70.4% 11934 Â 47% sched_debug.cpu.sched_count.4
40761 Â 13% -75.7% 9896 Â 39% sched_debug.cpu.sched_count.5
43041 Â 19% -79.9% 8636 Â 42% sched_debug.cpu.sched_count.6
38105 Â 12% -75.9% 9193 Â 40% sched_debug.cpu.sched_count.7
52184 Â 6% -56.3% 22782 Â 4% sched_debug.cpu.sched_count.avg
116288 Â 4% -20.9% 91972 Â 9% sched_debug.cpu.sched_count.max
33701 Â 9% -82.9% 5746 Â 4% sched_debug.cpu.sched_count.min
22760 Â 10% -63.0% 8418 Â 40% sched_debug.cpu.sched_goidle.0
23319 Â 13% -60.9% 9114 Â 22% sched_debug.cpu.sched_goidle.1
21273 Â 17% -80.4% 4169 Â 13% sched_debug.cpu.sched_goidle.2
19993 Â 19% -67.8% 6429 Â 45% sched_debug.cpu.sched_goidle.3
18614 Â 17% -85.0% 2788 Â 29% sched_debug.cpu.sched_goidle.4
18921 Â 12% -86.7% 2520 Â 15% sched_debug.cpu.sched_goidle.5
20131 Â 17% -82.1% 3596 Â 52% sched_debug.cpu.sched_goidle.6
17861 Â 12% -86.9% 2334 Â 14% sched_debug.cpu.sched_goidle.7
20359 Â 8% -75.8% 4921 Â 5% sched_debug.cpu.sched_goidle.avg
26477 Â 10% -60.2% 10539 Â 21% sched_debug.cpu.sched_goidle.max
15845 Â 10% -87.2% 2033 Â 4% sched_debug.cpu.sched_goidle.min
29043 Â 15% -58.8% 11958 Â 26% sched_debug.cpu.ttwu_count.0
24191 Â 10% -68.8% 7547 Â 27% sched_debug.cpu.ttwu_count.1
21313 Â 11% -72.7% 5819 Â 24% sched_debug.cpu.ttwu_count.2
21487 Â 13% -61.4% 8296 Â 43% sched_debug.cpu.ttwu_count.3
19644 Â 15% -54.4% 8967 Â 79% sched_debug.cpu.ttwu_count.4
20786 Â 15% -69.2% 6409 Â 58% sched_debug.cpu.ttwu_count.5
20435 Â 17% -79.3% 4231 Â 58% sched_debug.cpu.ttwu_count.6
19293 Â 17% -77.0% 4432 Â 55% sched_debug.cpu.ttwu_count.7
22024 Â 7% -67.3% 7207 Â 6% sched_debug.cpu.ttwu_count.avg
31009 Â 9% -45.2% 17008 Â 17% sched_debug.cpu.ttwu_count.max
16791 Â 10% -85.1% 2494 Â 5% sched_debug.cpu.ttwu_count.min
3084 Â 8% +25.5% 3870 Â 9% sched_debug.cpu.ttwu_local.avg

The URL of the original regression report email:

https://lists.01.org/pipermail/lkp/2016-January/003442.html

Best Regards,
Huang, Ying