@@ -373,6 +373,11 @@ static void del_edac_device_from_global_list(struct edac_device_ctl_info
init_completion(&edac_device->removal_complete);
call_rcu(&edac_device->rcu, complete_edac_device_list_del);
wait_for_completion(&edac_device->removal_complete);
+
+ /* hawk@comx.dk 2009-06-22: I think that rcu_barrier() should
+ * be used instead of wait_for_completion, because
+ * rcu_barrier() take multiple CPUs into account */
+ rcu_barrier();
}
/*
@@ -428,6 +428,11 @@ static void del_mc_from_global_list(struct mem_ctl_info *mci)
init_completion(&mci->complete);
call_rcu(&mci->rcu, complete_mc_list_del);
wait_for_completion(&mci->complete);
+
+ /* hawk@comx.dk 2009-06-22: I think that rcu_barrier() should
+ * be used instead of wait_for_completion, because
+ * rcu_barrier() take multiple CPUs into account */
+ rcu_barrier();
}
/**
@@ -188,6 +188,11 @@ static void del_edac_pci_from_global_list(struct edac_pci_ctl_info *pci)
init_completion(&pci->complete);
call_rcu(&pci->rcu, complete_edac_pci_list_del);
wait_for_completion(&pci->complete);
+
+ /* hawk@comx.dk 2009-06-22: I think that rcu_barrier() should
+ * be used instead of wait_for_completion, because
+ * rcu_barrier() take multiple CPUs into account */
+ rcu_barrier();
}
#if 0
Module edac_core.ko uses call_rcu() callbacks in edac_device.c, edac_mc.c and edac_pci.c. They all uses a wait_for_completion scheme, but this scheme it not 100% safe on multiple CPUs. See the _rcu_barrier() implementation which explains why extra precausion is needed. The patch adds a comment about rcu_barrier() and as a precausion calls rcu_barrier(). A maintainer needs to look at removing the wait_for_completion code. Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk> --- drivers/edac/edac_device.c | 5 +++++ drivers/edac/edac_mc.c | 5 +++++ drivers/edac/edac_pci.c | 5 +++++ 3 files changed, 15 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html