On 5/20/2025 1:04 PM, Borislav Petkov wrote:
On Tue, May 20, 2025 at 12:54:32PM -0700, Vijay Balakrishna wrote:
quoted
On 5/20/2025 9:09 AM, Vijay Balakrishna wrote:
quoted
On 5/19/2025 1:51 AM, Borislav Petkov wrote:
quoted
I'd venture a guess you need to protect here against CPU hotplug...
quoted
+ for_each_cpu_and(cpu, cpu_online_mask, &compat_mask) {
+ smp_call_function_single(cpu, read_errors, &merrsr, true);
+ report_errors(edac_ctl, cpu, &merrsr);
+ }
+}
+
Hi Boris,
I appreciate you highlighting the CPU hotplug issue. Upon further review
of surrounding code, I realized we must ensure that the data passed to
read_errors() is per-CPU.
Actually, per-CPU data not needed as we are passing true -- wait until
function has completed on other CPUs.
What happens if @cpu above gets offlined right before you do
smp_call_function_single() ?
We can see inconsistent behavior or kernel crash/hang. You are correct,
we need to protect against CPU hotplug. I will add
cpus_read_lock()/cpus_read_unlock().
Thanks,
Vijay