Bug 1941 - Make AMX state ready for CPU idle
Summary: Make AMX state ready for CPU idle
Status: RESOLVED FIXED
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: X86 (show other bugs) X86
Version: unspecified
Hardware: x86_64 Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: Guanjun
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-23 11:24 UTC by linwang
Modified: 2023-01-17 15:02 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description linwang intel_group 2022-08-23 11:24:59 UTC
Description of problem:
AMX state is a large state (at least 8KB or more). Entering CPU idle with
this non-initialized large state may result in shallow states while a
deeper low-power state is available.

This patch set ensures the AMX state is initialized before entering the CPU
idle state.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 linwang intel_group 2022-08-26 10:38:21 UTC
Following commits involved:

f17b168734c0 x86/fpu: Add a helper to prepare AMX state for low-power CPU idle
9f0112938277 intel_idle: Add a new flag to initialize the AMX state
32d4fd5751ea cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE
Comment 2 linwang intel_group 2022-08-26 10:41:16 UTC
During AMX stressing test(500 context switches of AMX states in 200 threads):
Package Core    CPU     Avg_MHz Busy%   Bzy_MHz TSC_MHz IPC     IRQ     SMI     POLL    C1      C6      POLL%   C1%     C6%     CPU%c1  CPU%c6  CoreTmp PkgTmp  PkgWatt RAMWatt PKG_%   RAM_%
-       -       -       458     15.85   2885    1902    0.31    494636  0       10      5170    46072   0.00    0.05    84.18   17.57   66.59   65      66      917.31  1.85    0.00    0.00
0       0       0       2715    100.00  2715    1900    0.31    6200    0       0       0       0       0.00    0.00    0.00    0.00    0.00    63      66      310.01  0.06    0.00    0.00
0       0       224     2       0.08    2676    1900    0.41    32      0       0       0       30      0.00    0.00    99.92   99.92
0       1       1       466     17.14   2720    1900    0.65    6699    0       0       928     5212    0.00    9.15    73.83   82.86   0.00    62
0       1       225     2717    100.00  2717    1900    0.31    6193    0       0       0       0       0.00    0.00    0.00    0.00
0       2       2       2714    100.00  2714    1900    0.31    6195    0       0       0       0       0.00    0.00    0.00    0.00    0.00    62
0       2       226     2       0.07    2711    1900    0.43    29      0       0       1       27      0.00    0.01    99.93   99.93
0       3       3       3       0.12    2728    1900    0.53    39      0       0       2       144     0.00    0.01    99.87   99.86   0.02    63
0       3       227     2713    99.98   2713    1900    0.32    6193    0       0       1       1       0.00    0.00    0.02    0.00
0       4       4       2       0.09    2687    1900    0.43    29      0       0       1       35      0.00    0.00    99.91   99.91   0.00    63
0       4       228     2709    99.98   2709    1900    0.32    6194    0       0       2       1       0.00    0.02    0.01    0.02
0       5       5       99      3.65    2717    1900    1.03    1135    0       2       966     3222    0.00    3.11    93.32   96.33   0.02    62
0       5       229     2716    99.97   2717    1900    0.31    6941    0       0       1       2       0.00    0.01    0.02    0.01
0       6       6       2       0.08    2783    1900    0.43    27      0       0       1       29      0.00    0.01    99.91   99.89   0.03    61
0       6       230     2718    99.97   2719    1900    0.31    6195    0       0       1       2       0.00    0.00    0.03    0.00
0       7       7       2       0.07    2720    1900    0.42    30      0       0       1       34      0.00    0.01    99.92   99.90   0.03    61
0       7       231     2713    99.97   2714    1900    0.32    6194    0       0       1       2       0.00    0.00    0.03    0.00
0       8       8       2       0.08    2747    1900    0.41    35      0       0       0       38      0.00    0.00    99.92   99.89   0.03    63
0       8       232     2715    99.97   2716    1900    0.31    6195    0       0       0       2       0.00    0.00    0.03    0.00
0       9       9       2       0.06    2690    1900    0.38    32      0       0       1       30      0.00    0.00    99.93   99.94   0.00    62
0       9       233     2715    100.00  2715    1900    0.31    6194    0       0       0       0       0.00    0.00    0.00    0.00
0       10      10      2       0.06    2712    1900    0.35    33      0       0       1       32      0.00    0.00    99.94   99.92   0.02    61
0       10      234     2714    99.97   2715    1900    0.31    6193    0       0       1       2       0.00    0.01    0.02    0.02
0       11      11      2       0.06    2754    1900    0.37    37      0       0       1       36      0.00    0.01    99.93   99.94   0.00    61
0       11      235     2713    100.00  2713    1900    0.32    6194    0       0       0       0       0.00    0.00    0.00    0.00
0       12      12      2       0.05    2780    1900    0.37    31      0       0       0       31      0.00    0.00    99.95   99.90   0.05    64
0       12      236     2715    99.94   2716    1900    0.31    6194    0       0       1       4       0.00    0.01    0.05    0.01
0       13      13      1       0.06    2692    1900    0.37    35      0       0       1       34      0.00    0.01    99.94   99.94   0.00    62
0       13      237     2715    99.97   2716    1900    0.31    6194    0       0       2       1       0.00    0.03    0.00    0.03
0       14      14      1       0.05    2683    1900    0.37    30      0       0       1       29      0.00    0.01    99.94   99.95   0.00    62
0       14      238     2716    99.96   2717    1900    0.31    6194    0       0       5       0       0.00    0.04    0.00    0.04
0       15      15      2709    100.00  2709    1900    0.32    6194    0       0       0       0       0.00    0.00    0.00    0.00    0.00    63
0       15      239     2       0.09    2672    1900    0.49    36      0       0       1       33      0.00    0.01    99.90   99.91
0       16      16      2716    100.00  2716    1900    0.31    6193    0       0       0       0       0.00    0.00    0.00    0.00    0.00    65

After AMX stressing:
Package Core    CPU     Avg_MHz Busy%   Bzy_MHz TSC_MHz IPC     IRQ     SMI     POLL    C1      C6      POLL%   C1%     C6%     CPU%c1  CPU%c6  CoreTmp PkgTmp  PkgWatt RAMWatt PKG_%   RAM_%
-       -       -       0       0.01    3141    1904    0.54    12431   0       1       398     14810   0.00    0.01    100.22  1.85    98.13   57      58      737.53  2.40    0.00    0.00
0       0       0       1       0.05    3241    1900    0.32    21      0       0       0       68      0.00    0.00    99.96   2.39    97.57   48      51      189.31  0.25    0.00    0.00
0       0       224     0       0.00    3443    1900    0.57    17      0       0       0       22      0.00    0.00    100.00  2.42
0       1       1       1       0.02    3450    1900    0.40    13      0       0       6       18      0.00    0.08    99.90   0.86    99.12   46
0       1       225     0       0.00    3042    1900    0.54    21      0       0       1       23      0.00    0.01    99.99   0.87
0       2       2       0       0.00    3575    1900    0.48    10      0       0       2       11      0.00    0.01    99.99   0.85    99.15   47
0       2       226     0       0.00    3410    1900    0.57    20      0       0       1       22      0.00    0.00    99.99   0.85
0       3       3       0       0.01    3144    1900    0.36    30      0       0       0       32      0.00    0.00    99.99   1.03    98.96   46
0       3       227     0       0.01    3170    1900    0.43    29      0       0       0       32      0.00    0.00    99.99   1.03
0       4       4       0       0.01    2892    1900    0.40    28      0       0       1       30      0.00    0.01    99.98   0.91    99.08   45
0       4       228     0       0.01    2885    1900    0.44    27      0       0       1       30      0.00    0.01    99.98   0.91
0       5       5       0       0.01    3353    1900    0.29    28      0       0       1       85      0.00    0.01    99.98   97.71   2.28    47
0       5       229     2       0.07    3474    1900    0.32    633     0       0       3       687     0.00    0.03    99.92   97.66
0       6       6       0       0.01    3164    1900    0.39    27      0       0       1       30      0.00    0.00    99.99   0.89    99.10   46
0       6       230     0       0.01    3189    1900    0.44    27      0       0       0       29      0.00    0.00    99.99   0.89
0       7       7       0       0.01    2939    1900    0.38    27      0       0       0       31      0.00    0.00    99.99   0.91    99.08   43
0       7       231     0       0.01    2940    1900    0.46    26      0       0       1       28      0.00    0.01    99.98   0.91
0       8       8       0       0.01    3191    1900    0.41    26      0       0       1       29      0.00    0.01    99.98   0.98    99.02   47
0       8       232     0       0.01    3188    1900    0.44    26      0       0       1       29      0.00    0.01    99.99   0.98
0       9       9       0       0.01    2906    1900    0.40    26      0       0       1       28      0.00    0.00    99.99   0.99    99.00   46
0       9       233     0       0.01    2928    1900    0.39    27      0       0       1       30      0.00    0.00    99.99   0.99
0       10      10      0       0.01    3145    1900    0.38    26      0       0       0       30      0.00    0.00    99.99   0.99    99.00   46
0       10      234     0       0.01    3123    1900    0.41    26      0       0       1       29      0.00    0.01    99.98   0.99
0       11      11      0       0.01    3161    1900    0.33    25      0       0       1       28      0.00    0.01    99.98   0.97    99.03   44
0       11      235     0       0.01    3165    1900    0.44    25      0       0       1       28      0.00    0.01    99.99   0.97
0       12      12      0       0.01    3169    1900    0.40    25      0       0       1       28      0.00    0.00    99.99   0.98    99.01   49
0       12      236     0       0.01    3100    1900    0.35    26      0       0       1       29      0.00    0.00    99.99   0.98
0       13      13      0       0.01    2909    1900    0.42    25      0       0       0       28      0.00    0.00    99.99   0.98    99.01   46
Comment 3 maqiao alibaba_cloud_group 2023-01-17 15:02:42 UTC
merged: https://gitee.com/anolis/cloud-kernel/pulls/670