[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [linux-2.6.18-xen] evtchn: adjust CPU notifier registration
# HG changeset patch # User Jan Beulich <jbeulich@xxxxxxxx> # Date 1378807571 -7200 # Node ID b94250095e987b539baa08c82d0f2861fa3c85fe # Parent f2d05cf62925cc1146c8ac37964b8f8bd82a69c3 evtchn: adjust CPU notifier registration While mostly benign in 2.6.18 (apart from avoiding registration of a notifier that would never do anything useful under !HOTPLUG_CPU), the distinction is quite relevant when backporting the driver to 2.6.16: register_cpu_notifier() is available to modules there even when !HOTPLUG_CPU, and thus no such notifier block must live in .cpuinit.data (or else modules calling register_cpu_notifier() will result in hitting an unmapped page when traversing the linked list of notifiers). Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- diff -r f2d05cf62925 -r b94250095e98 drivers/xen/evtchn/evtchn.c --- a/drivers/xen/evtchn/evtchn.c Thu Jun 20 14:38:29 2013 +0200 +++ b/drivers/xen/evtchn/evtchn.c Tue Sep 10 12:06:11 2013 +0200 @@ -492,7 +492,8 @@ static struct miscdevice evtchn_miscdev .fops = &evtchn_fops, }; -static int __cpuinit evtchn_cpu_notify(struct notifier_block *nfb, +#ifdef CONFIG_HOTPLUG_CPU +static int evtchn_cpu_notify(struct notifier_block *nfb, unsigned long action, void *hcpu) { int hotcpu = (unsigned long)hcpu; @@ -522,9 +523,10 @@ static int __cpuinit evtchn_cpu_notify(s return NOTIFY_OK; } -static struct notifier_block __cpuinitdata evtchn_cpu_nfb = { +static struct notifier_block evtchn_cpu_nfb = { .notifier_call = evtchn_cpu_notify }; +#endif static int __init evtchn_init(void) { @@ -543,7 +545,7 @@ static int __init evtchn_init(void) return err; } - register_cpu_notifier(&evtchn_cpu_nfb); + register_hotcpu_notifier(&evtchn_cpu_nfb); printk("Event-channel device installed.\n"); @@ -553,7 +555,7 @@ static int __init evtchn_init(void) static void __exit evtchn_cleanup(void) { misc_deregister(&evtchn_miscdev); - unregister_cpu_notifier(&evtchn_cpu_nfb); + unregister_hotcpu_notifier(&evtchn_cpu_nfb); } module_init(evtchn_init); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |