Skip to content

Commit 226f69a

Browse files
author
Ingo Molnar
committed
Merge tag 'please-pull-tangchen' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras into x86/urgent
Pull MCE fix from Tony Luck: "Fix problem in CMCI rediscovery code that was illegally migrating worker threads to other cpus." Signed-off-by: Ingo Molnar <mingo@kernel.org>
2 parents 2bbf0a1 + 85b9763 commit 226f69a

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

arch/x86/kernel/cpu/mcheck/mce_intel.c

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -285,34 +285,39 @@ void cmci_clear(void)
285285
raw_spin_unlock_irqrestore(&cmci_discover_lock, flags);
286286
}
287287

288+
static long cmci_rediscover_work_func(void *arg)
289+
{
290+
int banks;
291+
292+
/* Recheck banks in case CPUs don't all have the same */
293+
if (cmci_supported(&banks))
294+
cmci_discover(banks);
295+
296+
return 0;
297+
}
298+
288299
/*
289300
* After a CPU went down cycle through all the others and rediscover
290301
* Must run in process context.
291302
*/
292303
void cmci_rediscover(int dying)
293304
{
294-
int banks;
295-
int cpu;
296-
cpumask_var_t old;
305+
int cpu, banks;
297306

298307
if (!cmci_supported(&banks))
299308
return;
300-
if (!alloc_cpumask_var(&old, GFP_KERNEL))
301-
return;
302-
cpumask_copy(old, &current->cpus_allowed);
303309

304310
for_each_online_cpu(cpu) {
305311
if (cpu == dying)
306312
continue;
307-
if (set_cpus_allowed_ptr(current, cpumask_of(cpu)))
313+
314+
if (cpu == smp_processor_id()) {
315+
cmci_rediscover_work_func(NULL);
308316
continue;
309-
/* Recheck banks in case CPUs don't all have the same */
310-
if (cmci_supported(&banks))
311-
cmci_discover(banks);
312-
}
317+
}
313318

314-
set_cpus_allowed_ptr(current, old);
315-
free_cpumask_var(old);
319+
work_on_cpu(cpu, cmci_rediscover_work_func, NULL);
320+
}
316321
}
317322

318323
/*

0 commit comments

Comments
 (0)