Skip to content

x86/mce: Dynamically size space for machine check records

JIRA: https://issues.redhat.com/browse/RHEL-24864
Tested: can't reproduce the issue, sanity testing
Conflicts: avoiding backport a series of min()/max() patches to allow proper comparison between different sizes of integers by casting

commit 108c6494bdf1dfeaefc0a506e2f471aa92fafdd6
Author: Tony Luck tony.luck@intel.com
Date: Thu Mar 7 11:27:04 2024 -0800

x86/mce: Dynamically size space for machine check records  

Systems with a large number of CPUs may generate a large number of  
machine check records when things go seriously wrong. But Linux has  
a fixed-size buffer that can only capture a few dozen errors.  

Allocate space based on the number of CPUs (with a minimum value based  
on the historical fixed buffer that could store 80 records).  

  [ bp: Rename local var from tmpp to something more telling: gpool. ]  

Signed-off-by: Tony Luck <tony.luck@intel.com>  
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>  
Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>  
Reviewed-by: Avadhut Naik <avadhut.naik@amd.com>  
Link: https://lore.kernel.org/r/20240307192704.37213-1-tony.luck@intel.com  

Signed-off-by: Aristeu Rozanski arozansk@redhat.com

Merge request reports