Skip to contentSkip to conversation

xenstore notifier: atomic or blocking?

DISCUSSION Jan Beulich 2 participants 3 messages Oct 18, 2007 – Oct 26, 2007 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

Is there any reason why this notifier is atomic rather than blocking? 2.6.23 has it as a blocking one, and judging from its use this is the right thing to do.

Thanks, Jan

#1 lore raw

I expect the atomic one looked safer. :-) Feel free to send a patch.

-- Keir

Quoted 11 lines · Jan Beulich

Is there any reason why this notifier is atomic rather than blocking? 2.6.23 has it as a blocking one, and judging from its use this is the right thing to do.

Thanks, Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

There doesn't appear to be any need for it to be atomic.

As usual, written and tested against 2.6.23 and made apply against 2.6.18 without further testing.

drivers/xen/xenbus/xenbus_probe.c +4 -4
Index: head-2007-10-23/drivers/xen/xenbus/xenbus_probe.c
===================================================================
@@ -69,7 +69,7 @@ static unsigned long xen_store_mfn;
 
 extern struct mutex xenwatch_mutex;
 
-static ATOMIC_NOTIFIER_HEAD(xenstore_chain);
+static BLOCKING_NOTIFIER_HEAD(xenstore_chain);
 
 static void wait_for_devices(struct xenbus_driver *xendrv);
 
@@ -832,7 +832,7 @@ int register_xenstore_notifier(struct no
 	if (xenstored_ready > 0)
 		ret = nb->notifier_call(nb, 0, NULL);
 	else
-		atomic_notifier_chain_register(&xenstore_chain, nb);
+		blocking_notifier_chain_register(&xenstore_chain, nb);
 
 	return ret;
 }
@@ -840,7 +840,7 @@ EXPORT_SYMBOL_GPL(register_xenstore_noti
 
 void unregister_xenstore_notifier(struct notifier_block *nb)
 {
-	atomic_notifier_chain_unregister(&xenstore_chain, nb);
+	blocking_notifier_chain_unregister(&xenstore_chain, nb);
 }
 EXPORT_SYMBOL_GPL(unregister_xenstore_notifier);
 
@@ -855,7 +855,7 @@ void xenbus_probe(struct work_struct *un
 	xenbus_backend_probe_and_watch();
 
 	/* Notify others that xenstore is up */
-	atomic_notifier_call_chain(&xenstore_chain, 0, NULL);
+	blocking_notifier_call_chain(&xenstore_chain, 0, NULL);
 }