Skip to content

Commit 64a668f

Browse files
qzhuo2bp3tk0v
authored andcommitted
x86/mce/threshold: Remove the redundant this_cpu_dec_return()
The 'storm' variable points to this_cpu_ptr(&storm_desc). Access the 'stormy_bank_count' field through the 'storm' to avoid calling this_cpu_*() on the same per-CPU variable twice. This minor optimization reduces the text size by 16 bytes. $ size threshold.o.* text data bss dec hex filename 1395 1664 0 3059 bf3 threshold.o.old 1379 1664 0 3043 be3 threshold.o.new No functional changes intended. Signed-off-by: Qiuxu Zhuo <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Nikolay Borisov <[email protected]> Reviewed-by: Sohil Mehta <[email protected]> Reviewed-by: Yazen Ghannam <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c845cb8 commit 64a668f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/cpu/mce/threshold.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void cmci_storm_end(unsigned int bank)
9090
storm->banks[bank].in_storm_mode = false;
9191

9292
/* If no banks left in storm mode, stop polling. */
93-
if (!this_cpu_dec_return(storm_desc.stormy_bank_count))
93+
if (!--storm->stormy_bank_count)
9494
mce_timer_kick(false);
9595
}
9696

0 commit comments

Comments
 (0)