All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org, mingo@kernel.org,
	wdauchy@gmail.com, tglx@linutronix.de, tony.luck@intel.com,
	gong.chen@linux.intel.com, linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/urgent] x86, CMCI: Add proper detection of end of CMCI storms
Date: Fri, 11 Apr 2014 10:01:09 -0700	[thread overview]
Message-ID: <53481FD5.9000405@zytor.com> (raw)
In-Reply-To: <tip-27f6c573e0f77f7d1cc907c1494c99a61e48b7d8@git.kernel.org>

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



  parent reply	other threads:[~2014-04-11 17:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tip-27f6c573e0f77f7d1cc907c1494c99a61e48b7d8@git.kernel.org>
2014-04-02  8:51 ` [tip:x86/urgent] x86, CMCI: Add proper detection of end of CMCI storms William Dauchy
2014-04-02  9:01   ` Borislav Petkov
2014-04-02  9:06     ` William Dauchy
2014-04-02 10:46     ` Ingo Molnar
2014-04-02 10:52       ` Borislav Petkov
2014-04-11 17:01 ` H. Peter Anvin [this message]
2014-04-14  8:39 ` [PATCH 1/2] x86, CMCI: Fix a missed put_cpu_var Chen, Gong
2014-04-14  8:39   ` [PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var Chen, Gong
2014-04-14 16:19     ` H. Peter Anvin
2014-04-14 16:20     ` H. Peter Anvin
2014-04-14 16:23     ` H. Peter Anvin
2014-04-15  2:28       ` Chen, Gong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53481FD5.9000405@zytor.com \
    --to=hpa@zytor.com \
    --cc=gong.chen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=wdauchy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.