Skip to content

Commit

Permalink
Merge tag 'please-pull-tangchen' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/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>
  • Loading branch information
Ingo Molnar committed Nov 13, 2012
2 parents 2bbf0a1 + 85b9763 commit 226f69a
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions arch/x86/kernel/cpu/mcheck/mce_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,34 +285,39 @@ void cmci_clear(void)
raw_spin_unlock_irqrestore(&cmci_discover_lock, flags);
}

static long cmci_rediscover_work_func(void *arg)
{
int banks;

/* Recheck banks in case CPUs don't all have the same */
if (cmci_supported(&banks))
cmci_discover(banks);

return 0;
}

/*
* After a CPU went down cycle through all the others and rediscover
* Must run in process context.
*/
void cmci_rediscover(int dying)
{
int banks;
int cpu;
cpumask_var_t old;
int cpu, banks;

if (!cmci_supported(&banks))
return;
if (!alloc_cpumask_var(&old, GFP_KERNEL))
return;
cpumask_copy(old, &current->cpus_allowed);

for_each_online_cpu(cpu) {
if (cpu == dying)
continue;
if (set_cpus_allowed_ptr(current, cpumask_of(cpu)))

if (cpu == smp_processor_id()) {
cmci_rediscover_work_func(NULL);
continue;
/* Recheck banks in case CPUs don't all have the same */
if (cmci_supported(&banks))
cmci_discover(banks);
}
}

set_cpus_allowed_ptr(current, old);
free_cpumask_var(old);
work_on_cpu(cpu, cmci_rediscover_work_func, NULL);
}
}

/*
Expand Down

0 comments on commit 226f69a

Please sign in to comment.