All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@amd64.org>
To: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Luck, Tony" <tony.luck@intel.com>,
	Borislav Petkov <bp@amd64.org>
Subject: Re: [PATCH 6/8] x86, mce: introduce mce_memory_failure_process()
Date: Fri, 17 Jun 2011 18:59:55 +0200	[thread overview]
Message-ID: <20110617165955.GG20010@aftab> (raw)
In-Reply-To: <4DFB1476.40804@jp.fujitsu.com>

On Fri, Jun 17, 2011 at 04:46:46AM -0400, Hidetoshi Seto wrote:
> And relocate related functions to near by mce_ring* routines.
> 
> Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
> ---
>  arch/x86/kernel/cpu/mcheck/mce.c |   26 +++++++++++++++++---------
>  1 files changed, 17 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
> index 0424299..a118496 100644
> --- a/arch/x86/kernel/cpu/mcheck/mce.c
> +++ b/arch/x86/kernel/cpu/mcheck/mce.c
> @@ -395,6 +395,8 @@ static inline void mce_gather_info(struct mce *m, struct pt_regs *regs)
>  }
>  
>  /*
> + * mce_ring, mce_memory_failure: Support for Memory errors
> + *
>   * Simple lockless ring to communicate PFNs from the exception handler with the
>   * process context work function. This is vastly simplified because there's
>   * only a single reader and a single writer.
> @@ -449,6 +451,20 @@ static int mce_ring_add(unsigned long pfn)
>  	return 0;
>  }
>  
> +/* dummy to break dependency. actual code is in mm/memory-failure.c */
> +void __attribute__((weak)) memory_failure(unsigned long pfn, int vector)
> +{
> +	pr_err("Action optional memory failure at %lx ignored\n", pfn);
> +}
> +
> +static inline void mce_memory_failure_process(void)
> +{
> +	unsigned long pfn;
> +
> +	while (mce_ring_get(&pfn))
> +		memory_failure(pfn, MCE_VECTOR);
> +}
> +

Frankly, I don't see the need to carve out two lines of code into a
function to avoid duplication and causing needless churn for this.

Just do the

	while (..)
		memory_failure(..)

in the next patch and that's it. mce.c is already cluttered with too
much stuff anyway.

>  static int mce_available(struct cpuinfo_x86 *c)
>  {
>  	if (mce_disabled)
> @@ -1049,12 +1065,6 @@ out:
>  }
>  EXPORT_SYMBOL_GPL(do_machine_check);
>  
> -/* dummy to break dependency. actual code is in mm/memory-failure.c */
> -void __attribute__((weak)) memory_failure(unsigned long pfn, int vector)
> -{
> -	printk(KERN_ERR "Action optional memory failure at %lx ignored\n", pfn);
> -}
> -
>  /*
>   * Called after mce notification in process context. This code
>   * is allowed to sleep. Call the high level VM handler to process
> @@ -1068,10 +1078,8 @@ void __attribute__((weak)) memory_failure(unsigned long pfn, int vector)
>   */
>  void mce_notify_process(void)
>  {
> -	unsigned long pfn;
>  	mce_notify_irq();
> -	while (mce_ring_get(&pfn))
> -		memory_failure(pfn, MCE_VECTOR);
> +	mce_memory_failure_process();
>  }
>  
>  static void mce_process_work(struct work_struct *dummy)
> -- 
> 1.7.1
> 
> 
> 

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

  reply	other threads:[~2011-06-17 17:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-17  8:37 [PATCH 0/8] x86, mce: misc fix/cleanups, cont Hidetoshi Seto
2011-06-17  8:40 ` [PATCH 1/8] x86, mce: stop calling del_timer_sync() from interrupt Hidetoshi Seto
2011-06-17 13:56   ` Borislav Petkov
2011-06-20  4:46     ` Hidetoshi Seto
2011-06-20  7:36       ` Borislav Petkov
2011-08-26 10:50   ` Borislav Petkov
2011-06-17  8:42 ` [PATCH 2/8] x86, mce: remove redundant mce_available() checks Hidetoshi Seto
2011-06-17 14:39   ` Borislav Petkov
2011-06-20  4:47     ` Hidetoshi Seto
2011-06-20  7:44       ` Borislav Petkov
2011-06-17  8:43 ` [PATCH 3/8] x86, mce: introduce mce_timer_add() Hidetoshi Seto
2011-06-17 15:11   ` Borislav Petkov
2011-06-17  8:44 ` [PATCH 4/8] x86, mce: rename bootparam parser Hidetoshi Seto
2011-06-17 15:41   ` Borislav Petkov
2011-06-17 22:25     ` Luck, Tony
2011-06-18  8:38       ` Borislav Petkov
2011-06-20  4:48         ` Hidetoshi Seto
2011-06-17  8:45 ` [PATCH 5/8] x86, mce: introduce mce_sysdev_init() Hidetoshi Seto
2011-06-17 16:32   ` Borislav Petkov
2011-06-20  4:48     ` Hidetoshi Seto
2011-06-17  8:46 ` [PATCH 6/8] x86, mce: introduce mce_memory_failure_process() Hidetoshi Seto
2011-06-17 16:59   ` Borislav Petkov [this message]
2011-06-17  8:49 ` [PATCH 7/8] x86, mce: rework use of TIF_MCE_NOTIFY Hidetoshi Seto
2011-06-17  8:50 ` [PATCH 8/8] x86, mce, edac: call edac_mce_parse() once per a record Hidetoshi Seto
2011-06-17 17:10   ` Borislav Petkov

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=20110617165955.GG20010@aftab \
    --to=bp@amd64.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=seto.hidetoshi@jp.fujitsu.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /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.