Skip to content

Commit a472ad2

Browse files
yu-chen-surfrafaeljw
authored andcommitted
intel_idle: Customize IceLake server support
On ICX platform, the C1E auto-promotion is enabled by default. As a result, the CPU might fall into C1E more offen than previous platforms. Besides, the C1E is not exposed to sysfs on ICX, which is inconsistent with previous server platforms. So disable C1E auto-promotion and expose C1E as a separate idle state, so the C1E and C6 can be disabled via sysfs when necessary. Beside C1 and C1E, the exit latency of C6 was measured by a dedicated tool. However the exit latency(41us) exposed by _CST is much smaller than the one we measured(128us). This is probably due to the _CST uses the exit latency when woken up from PC0+C6, rather than PC6+C6 when C6 was measured. Choose the latter as we need the longest latency in theory. Reported-by: kernel test robot <[email protected]> Tested-by: Artem Bityutskiy <[email protected]> Acked-by: Artem Bityutskiy <[email protected]> Reviewed-by: Zhang Rui <[email protected]> Signed-off-by: Chen Yu <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent efe9711 commit a472ad2

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

drivers/idle/intel_idle.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,35 @@ static struct cpuidle_state skx_cstates[] __initdata = {
752752
.enter = NULL }
753753
};
754754

755+
static struct cpuidle_state icx_cstates[] __initdata = {
756+
{
757+
.name = "C1",
758+
.desc = "MWAIT 0x00",
759+
.flags = MWAIT2flg(0x00),
760+
.exit_latency = 1,
761+
.target_residency = 1,
762+
.enter = &intel_idle,
763+
.enter_s2idle = intel_idle_s2idle, },
764+
{
765+
.name = "C1E",
766+
.desc = "MWAIT 0x01",
767+
.flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE,
768+
.exit_latency = 4,
769+
.target_residency = 4,
770+
.enter = &intel_idle,
771+
.enter_s2idle = intel_idle_s2idle, },
772+
{
773+
.name = "C6",
774+
.desc = "MWAIT 0x20",
775+
.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
776+
.exit_latency = 128,
777+
.target_residency = 384,
778+
.enter = &intel_idle,
779+
.enter_s2idle = intel_idle_s2idle, },
780+
{
781+
.enter = NULL }
782+
};
783+
755784
static struct cpuidle_state atom_cstates[] __initdata = {
756785
{
757786
.name = "C1E",
@@ -1056,6 +1085,12 @@ static const struct idle_cpu idle_cpu_skx __initconst = {
10561085
.use_acpi = true,
10571086
};
10581087

1088+
static const struct idle_cpu idle_cpu_icx __initconst = {
1089+
.state_table = icx_cstates,
1090+
.disable_promotion_to_c1e = true,
1091+
.use_acpi = true,
1092+
};
1093+
10591094
static const struct idle_cpu idle_cpu_avn __initconst = {
10601095
.state_table = avn_cstates,
10611096
.disable_promotion_to_c1e = true,
@@ -1110,6 +1145,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
11101145
X86_MATCH_INTEL_FAM6_MODEL(KABYLAKE_L, &idle_cpu_skl),
11111146
X86_MATCH_INTEL_FAM6_MODEL(KABYLAKE, &idle_cpu_skl),
11121147
X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_X, &idle_cpu_skx),
1148+
X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, &idle_cpu_icx),
11131149
X86_MATCH_INTEL_FAM6_MODEL(XEON_PHI_KNL, &idle_cpu_knl),
11141150
X86_MATCH_INTEL_FAM6_MODEL(XEON_PHI_KNM, &idle_cpu_knl),
11151151
X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT, &idle_cpu_bxt),

0 commit comments

Comments
 (0)