Re: [PATCH 1/6] HWPOISON: clean up memory_failure() vs.__memory_failure()

From: Ingo Molnar
Date: Wed Dec 14 2011 - 02:49:43 EST



* Tony Luck <tony.luck@xxxxxxxxx> wrote:

> There is only one caller of memory_failure(), all other users call
> __memory_failure() and pass in the flags argument explicitly. The
> lone user of memory_failure() will soon need to pass flags too.
>
> Add flags argument to the callsite in mce.c. Delete the old memory_failure()
> function, and then rename __memory_failure() without the leading "__".
>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---
> arch/x86/kernel/cpu/mcheck/mce.c | 9 +++++--
> drivers/base/memory.c | 2 +-
> include/linux/mm.h | 3 +-
> mm/hwpoison-inject.c | 4 +-
> mm/madvise.c | 2 +-
> mm/memory-failure.c | 46 +++++++++++++++++--------------------
> 6 files changed, 32 insertions(+), 34 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
> index 2af127d..265139d 100644
> --- a/arch/x86/kernel/cpu/mcheck/mce.c
> +++ b/arch/x86/kernel/cpu/mcheck/mce.c
> @@ -1046,11 +1046,14 @@ 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)
> +#ifndef CONFIG_MEMORY_FAILURE
> +int memory_failure(unsigned long pfn, int vector, int flags)
> {
> printk(KERN_ERR "Action optional memory failure at %lx ignored\n", pfn);

Btw., while at it, could we phrase this message in a more
obvious way to users, such as 'Non-fatal memory failure at %lx
ignored'?

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/