[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160302131824.GH26686@dhcp22.suse.cz>
Date: Wed, 2 Mar 2016 14:18:24 +0100
From: Michal Hocko <mhocko@...nel.org>
To: Hidehiro Kawai <hidehiro.kawai.ez@...achi.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Thomas Mingarelli <thomas.mingarelli@....com>,
Wim Van Sebroeck <wim@...ana.be>,
Corey Minyard <minyard@....org>,
Javi Merino <javi.merino@....com>,
linux-watchdog@...r.kernel.org,
"Steven Rostedt (Red Hat)" <rostedt@...dmis.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
linux-kernel@...r.kernel.org,
Michal Nazarewicz <mina86@...a86.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
HATAYAMA Daisuke <d.hatayama@...fujitsu.com>,
Borislav Petkov <bp@...en8.de>,
Gobinda Charan Maji <gobinda.cemk07@...il.com>,
Tejun Heo <tj@...nel.org>,
Nicolas Iooss <nicolas.iooss_linux@....org>,
openipmi-developer@...ts.sourceforge.net,
Borislav Petkov <bp@...e.de>,
Thomas Gleixner <tglx@...utronix.de>,
Guenter Roeck <linux@...ck-us.net>
Subject: Re: [v2 PATCH 1/3] panic: Change nmi_panic from macro to function
On Wed 02-03-16 19:36:26, Hidehiro Kawai wrote:
[...]
> +void nmi_panic(struct pt_regs *regs, const char *fmt, ...)
Do we really need vargs? All the current users seem to be OK with a
simple string. This makes the code slightly more complicated without any
apparent reason.
> +{
> + static char buf[1024]; /* protected by panic_cpu */
> + va_list args;
> + int old_cpu, cpu;
> +
> + cpu = raw_smp_processor_id();
> + old_cpu = atomic_cmpxchg(&panic_cpu, PANIC_CPU_INVALID, cpu);
> +
> + if (old_cpu == PANIC_CPU_INVALID) {
> + va_start(args, fmt);
> + vsnprintf(buf, sizeof(buf), fmt, args);
> + va_end(args);
> +
> + panic("%s", buf);
> + } else if (old_cpu != cpu)
> + nmi_panic_self_stop(regs);
> +}
> +EXPORT_SYMBOL(nmi_panic);
> +
> /**
> * panic - halt the system
> * @fmt: The text string to print
>
>
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists