[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1330969747.11248.250.camel@twins>
Date: Mon, 05 Mar 2012 18:49:07 +0100
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: Li Zhong <zhong@...ux.vnet.ibm.com>
Cc: LKML <linux-kernel@...r.kernel.org>, tglx@...utronix.de,
mingo@...hat.com, hpa@...or.com, x86@...nel.org, paulus@...ba.org,
mingo@...e.hu, acme@...stprotocols.net,
Vegard Nossum <vegardno@....uio.no>,
Don Zickus <dzickus@...hat.com>, tony.luck@...el.com,
bp@...64.org, robert.richter@....com, lenb@...nel.org,
minyard@....org, wim@...ana.be, linux-edac@...r.kernel.org,
oprofile-list@...ts.sf.net, linux-acpi@...r.kernel.org,
openipmi-developer@...ts.sourceforge.net,
linux-watchdog@...r.kernel.org
Subject: Re: [PATCH v2 x86 1/2] fix page faults by nmiaction in nmi if
kmemcheck is enabled
On Mon, 2012-03-05 at 18:05 +0800, Li Zhong wrote:
> +static struct nmiaction arch_trigger_all_cpu_bt_nmiaction = {
> + .handler = arch_trigger_all_cpu_backtrace_handler,
> + .name = "arch_bt",
> +};
> +
> static int __init register_trigger_all_cpu_backtrace(void)
> {
> - register_nmi_handler(NMI_LOCAL, arch_trigger_all_cpu_backtrace_handler,
> - 0, "arch_bt");
> + register_nmi_handler(NMI_LOCAL, &arch_trigger_all_cpu_bt_nmiaction);
> return 0;
> }
If you look at things like cpu_notifier() you can shorten this still:
#define nmi_notifier(t, fn, n) \
do { \
static struct nmiaction fn##_na = { \
.handler = (fn), \
.name = (n), \
}; \
register_nmi_handler((t), &fn##_na); \
} while (0)
The whole thing then becomes:
nmi_notifier(NMI_LOCAL, arch_trigger_all_cpu_backtrace_handler, "arch_bt");
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists