lkml.org 
[lkml]   [2014]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:x86/urgent] x86, CMCI: Add proper detection of end of CMCI storms
On 04/02/2014 12:55 AM, tip-bot for Chen, Gong wrote:
> @@ -614,6 +618,8 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
> if (!(m.status & MCI_STATUS_VAL))
> continue;
>
> + v = &get_cpu_var(mce_polled_error);
> + set_bit(0, v);
> /*
> * Uncorrected or signalled events are handled by the exception
> * handler when it is enabled, so don't process those here.
> @@ -1278,10 +1284,18 @@ static unsigned long mce_adjust_timer_default(unsigned long interval)
> static unsigned long (*mce_adjust_timer)(unsigned long interval) =
> mce_adjust_timer_default;
>
> +static int cmc_error_seen(void)
> +{
> + unsigned long *v = &__get_cpu_var(mce_polled_error);
> +
> + return test_and_clear_bit(0, v);
> +}
> +

Please use this_cpu_*() whereever possible instead of __get_cpu_var().
Since this is not actually a bitmask this_cpu_xchg() can be used at the end.

In fact, using set_bit() is completely wasteful.

I'll push this onward since it is a bit late, but please submit a
cleanup patch.

-hpa




\
 
 \ /
  Last update: 2014-04-11 20:41    [W:0.025 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site