Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1274742

Re: [UNTESTED PATCH] x86, mce: Avoid double entry of deferred errors into the genpool.

From Borislav Petkov <bp@alien8.de>
Newsgroups linux.kernel
Subject Re: [UNTESTED PATCH] x86, mce: Avoid double entry of deferred errors into the genpool.
Date 2015-11-21 20:20 +0100
Message-ID <qxlRv-1b2-15@gated-at.bofh.it> (permalink)
References <qtJpo-71V-17@gated-at.bofh.it> <qtM3W-lk-77@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Nov 11, 2015 at 02:01:51PM -0800, Tony Luck wrote:
> We used to have a special ring buffer for deferred errors that
> was used to mark problem pages. We replaced that with a genpool.
> Then later converted mce_log() to also use the same genpool. As
> a result we end up adding all deferred errors to the genpool twice.
> 
> Rearrange this code. Make sure to set the m.severity and m.usable_addr
> fields for deferred errors. Then if flags and mca_cfg.dont_log_ce mean
> we call mce_log() we are done, because that will add this entry to the
> genpool.
> 
> If we skipped mce_log(), then we still want to take action for the
> deferred error, so add to the genpool.
> 
> Changed the name of the boolean "error_logged" to "error_seen", we
> should set it whether of not we logged an error because the return
> value from machine_check_poll() is used to decide whether storms
> have subsided or not.
> 
> Reported-by: Chen, Gong <gong.chen.linux.intel.com>
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
>  arch/x86/kernel/cpu/mcheck/mce.c | 24 +++++++++++++-----------
>  1 file changed, 13 insertions(+), 11 deletions(-)

...

> @@ -626,9 +621,16 @@ bool machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
>  		 * Don't get the IP here because it's unlikely to
>  		 * have anything to do with the actual error location.
>  		 */
> -		if (!(flags & MCP_DONTLOG) && !mca_cfg.dont_log_ce) {
> -			error_logged = true;
> +		if (!(flags & MCP_DONTLOG) && !mca_cfg.dont_log_ce)
>  			mce_log(&m);
> +		else if (m.usable_addr) {
> +			/*
> +			 * Although we skipped logging this, we still want
> +			 * to take action. Add to the pool so the registered
> +			 * notifiers will see it.
> +			 */
> +			if (!mce_gen_pool_add(&m))
> +				mce_schedule_work();

Right, this still causes the error to come out on AMD because the
notifier calls amd_decode_mce().

I guess we can extend the "if (m.usable_addr)" check above with "if
error is not CE" too and only add it to the generic pool when its
severity is anything stronger than MCE_KEEP_SEVERITY...

Also, two more fixes I've done while injecting in a kvm guest I'm
sending as a reply to this message. Will inject on a real box too.

Thanks.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [UNTESTED PATCH] x86, mce: Avoid double entry of deferred errors  into the genpool. Borislav Petkov <bp@alien8.de> - 2015-11-21 20:20 +0100
  RE: [UNTESTED PATCH] x86, mce: Avoid double entry of deferred  errors into the genpool. "Luck, Tony" <tony.luck@intel.com> - 2015-11-24 01:20 +0100
    Re: [UNTESTED PATCH] x86, mce: Avoid double entry of deferred errors  into the genpool. Borislav Petkov <bp@alien8.de> - 2015-11-24 08:40 +0100
      RE: [UNTESTED PATCH] x86, mce: Avoid double entry of deferred  errors into the genpool. "Luck, Tony" <tony.luck@intel.com> - 2015-11-24 17:00 +0100
        Re: [UNTESTED PATCH] x86, mce: Avoid double entry of deferred errors  into the genpool. Borislav Petkov <bp@alien8.de> - 2015-11-24 20:00 +0100

csiph-web