Re: [PATCH 3/4] sched: introduce synchronized idle injection

Jacob Pan
2015-11-24T11:38:58Z

On Fri, 20 Nov 2015 11:58:12 +0100 (CET)
Thomas Gleixner <tglx@linutronix.de> wrote:

> if (machine_on_fire) {
Just to add data to show this is not just for emergency. I have an
broadwell laptop, here is the test I did.
- clamp cpu freq to 900MHz (close to max efficiency)
- run gpu and cpu load (cut-the-rop, glxgears)
- turn fans off

run tmon (tools/thermal/tmon) to show temperatures and thermal trip
points. (sorry about the long lines, quite a few thermal sensors)
Also run turbostat to show CPU idle etc.

Observations:
without idle injection:
------------------------------------------------------------------
- package temp rise to 66C crossing the second active trip points
(2nd fan speed should kick in if not disabled)
- package power 9.47w
- cpu c0 ~90%, 0% core c7
------------------------------------------------------------------
- with idle injection 20%
- cpu c0 ~67%, ~13% core c7, ~7% package c-states
- package power 4.53w
- package temp 52C

glxgears maintains the same frame rate. didnt measure cut-the-rope
but still plays.

This is a large 14 inch laptop with much better cooling than a fanless
tablet/convertible. So hitting thermal constraints can happen in _NORMAL_
condition (even at 900MHz), not just on fire case.

Sync up idle can save energy efficiency and i think scheduler is a better
place to solve that problem, perhaps with PM QoS constraint will have less
perceived intrusive behavior.

Thanks,

Jacob

│Trip Points: AAAAC C AAPHCPP APHCPP PHCPP AAPHCPP AAAAPHCPP APHCPP AAAAPHC PP │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────── COOLING DEVICES ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ID Cooling Dev Cur Max Thermal Zone Binding │
│00 TFN1 4 11 │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ ││││││││││││ │
│01 Fan 0 1 │││*│││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ ││││││││││││ │
│02 Fan 0 1 ││*││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ ││││││││││││ │
│03 Fan 0 1 │*│││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ ││││││││││││ │
│04 Fan 0 1 *││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ ││││││││││││ │
│05 CHRG 4 4 │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ ││││││││││││ │
│06 intel_powerc -1 50 │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ │││││││││││ ││││││││││││ │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 10 20 30 40 50 60 70 80 90 100 110 120 │
│acpitz 0:[ 66][→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→A55→→→→→→→A65 A75 A85 C111 ] │
│pch_wi 1:[ 59][→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→ C115 ] │
│INT340 2:[ 20][→→→→→→→→→→→→→→→→→→→→→ ] │
│ SEN1 3:[ 47][P0→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→ A58 A63 P71 H100103 ] │
│ SEN2 4:[ 51][P0→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→ A63 P71 H100103 ] │
│ SEN3 5:[ 46][P0→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→ P71 H100103 ] │
│ SEN4 6:[ 45][P0→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→ A58 A63 P71 H100103 ] │
│ SEN6 7:[ 46][P0→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→ A48 A53 A58 A63 P71 H100103 ] │
│ SEN7 8:[ 27][P0→→→→→→→→→→→→→→→→→→→→→→→→→→ A63 P71 H100103 ] │
│ B0D4 9:[ 66][→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→A55→→→→→→→A65 A75 A85 P102045 ] │
│x86_pk10:[ 66][P0→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→ ] │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
turbostat without idle injection
1 3 776 86.37 898 2295 0 11.90
Core CPU Avg_MHz %Busy Bzy_MHz TSC_MHz SMI CPU%c1 CPU%c3 CPU%c6 CPU%c7 CoreTmp PkgTmp Pkg%pc2 Pkg%pc3 Pkg%pc6 Pkg%pc7 Pkg%pc8 Pkg%pc9 Pk%pc10 PkgWatt CorWatt GFXWatt
- - 801 89.16 898 2295 0 9.77 0.55 0.07 0.44 66 70 0.00 0.00 0.00 0.00 0.00 0.00 0.00 9.47 4.31 1.17
0 0 801 89.26 898 2294 0 9.76 0.57 0.07 0.34 64 70 0.00 0.00 0.00 0.00 0.00 0.00 0.00 9.47 4.31 1.17
0 2 803 89.43 898 2294 0 9.58
1 1 810 90.27 898 2295 0 8.59 0.52 0.07 0.55 66
1 3 787 87.69 898 2295 0 11.17

turbostat with 20% idle injection
Core CPU Avg_MHz %Busy Bzy_MHz TSC_MHz SMI CPU%c1 CPU%c3 CPU%c6 CPU%c7 CoreTmp PkgTmp Pkg%pc2 Pkg%pc3 Pkg%pc6 Pkg%pc7 Pkg%pc8 Pkg%pc9 Pk%pc10 PkgWatt CorWatt GFXWatt
- - 601 66.92 898 2295 0 13.48 4.65 1.09 13.86 52 52 3.50 0.60 0.46 2.30 0.00 0.00 0.00 4.53 1.99 0.17
0 0 605 67.36 898 2294 0 12.75 5.95 1.51 12.42 51 52 3.50 0.60 0.46 2.30 0.00 0.00 0.00 4.53 1.99 0.17
0 2 583 64.94 898 2295 0 15.18
1 1 605 67.37 898 2295 0 13.31 3.34 0.67 15.30 52
1 3 611 68.02 898 2295 0 12.66

~
~
~

> defer_timer_interrupt(5ms);
> end = now + 5ms:
> while (now < end)
> mwait();
> }

[Jacob Pan]