datapath: Call rcu_barrier() before unloading module.
authorBen Pfaff <blp@nicira.com>
Thu, 7 May 2009 00:35:40 +0000 (17:35 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 12 May 2009 23:21:57 +0000 (16:21 -0700)
According to article "RCU and Unloadable Modules" available at lwn.net,
a module that uses RCU callbacks should call rcu_barrier() before
unloading, because synchronize_rcu() does not ensure that all RCU callbacks
have actually completed, only that a grace period has elapsed.

datapath/datapath.c

index 252e3e0067ab8a047a0c115b4f9b9bb46188d674..d3dd6909ba9a4dec955a09680939a986dfa1189d 100644 (file)
@@ -1648,6 +1648,7 @@ error:
 
 static void dp_cleanup(void)
 {
+       rcu_barrier();
        unregister_chrdev(major, "openvswitch");
        unregister_netdevice_notifier(&dp_device_notifier);
        flow_exit();