Re: [PATCH 09/10] MCE: run through processors with more severe problems first

Hidetoshi Seto
2011-06-10T08:09:56Z

(2011/06/10 6:37), Luck, Tony wrote:
> From: Tony Luck <tony.luck@intel.com>
>
> Instead of letting cpus run through the MC bank scanning code
> in the order that they turned up in the handler, we arrange to
> deal with those that have more severe problems (mcgstatus.ripv=0)
> first. This will make life simpler in the case that banks are
> shared between processors, since the cpu with the problem will
> see it and clear it, leaving the other cpu(s) that share the
> bank with nothing to do.

Well, I agree about the point that reordering is required to handle
shared banks.

I think it is better to put this change in early of the series.

>
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
(snip)
> +/*
> + * next cpu choosing first from cant_return, and then from can_return
> + */
> +int mce_nextcpu(int this)
> +{
> + int next;
> +
> + if (this == -1 || cpumask_test_cpu(this, &cant_return)) {
> + next = cpumask_next(this, &cant_return);
> + if (next >= nr_cpu_ids)
> + next = cpumask_next(-1, &can_return);
> + return next;
> + }
> +
> + return cpumask_next(this, &can_return);
> +}

I don't like to have multiple cpumasks here, notably one is just an
inversion of another...

How about using severity-leveling?
Pick cpus with PANIC level first, then AR, AO ...

Or how about checking rip in each mces_seen?

Thanks,
H.Seto