Skip to content

Commit a8fb409

Browse files
Deepak Sharmarafaeljw
authored andcommitted
x86: ACPI: cstate: Optimize C3 entry on AMD CPUs
All Zen or newer CPU which support C3 shares cache. Its not necessary to flush the caches in software before entering C3. This will cause drop in performance for the cores which share some caches. ARB_DIS is not used with current AMD C state implementation. So set related flags correctly. Signed-off-by: Deepak Sharma <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent aa06e20 commit a8fb409

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

arch/x86/kernel/acpi/cstate.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@ void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
7979
*/
8080
flags->bm_control = 0;
8181
}
82+
if (c->x86_vendor == X86_VENDOR_AMD && c->x86 >= 0x17) {
83+
/*
84+
* For all AMD Zen or newer CPUs that support C3, caches
85+
* should not be flushed by software while entering C3
86+
* type state. Set bm->check to 1 so that kernel doesn't
87+
* need to execute cache flush operation.
88+
*/
89+
flags->bm_check = 1;
90+
/*
91+
* In current AMD C state implementation ARB_DIS is no longer
92+
* used. So set bm_control to zero to indicate ARB_DIS is not
93+
* required while entering C3 type state.
94+
*/
95+
flags->bm_control = 0;
96+
}
8297
}
8398
EXPORT_SYMBOL(acpi_processor_power_init_bm_check);
8499

0 commit comments

Comments
 (0)