Messages in this thread | | | Date | Fri, 11 Apr 2014 10:01:09 -0700 | From | "H. Peter Anvin" <> | Subject | Re: [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
| |